Search in sources :

Example 1 with RetryTransientErrorsPolicy

use of com.yahoo.messagebus.routing.RetryTransientErrorsPolicy in project vespa by vespa-engine.

the class MessageBusTestCase method requireThatBucketSequencingWithResenderEnabledCausesError.

@Test
public void requireThatBucketSequencingWithResenderEnabledCausesError() throws ListenFailedException {
    Slobrok slobrok = new Slobrok();
    TestServer server = new TestServer(new MessageBusParams().addProtocol(new SimpleProtocol()).setRetryPolicy(new RetryTransientErrorsPolicy()), new RPCNetworkParams().setSlobrokConfigId(slobrok.configId()));
    Receptor receptor = new Receptor();
    SourceSession session = server.mb.createSourceSession(new SourceSessionParams().setTimeout(600.0).setReplyHandler(receptor));
    assertTrue(session.send(new SimpleMessage("foo") {

        @Override
        public boolean hasBucketSequence() {
            return true;
        }
    }.setRoute(Route.parse("bar"))).isAccepted());
    Reply reply = receptor.getReply(60);
    assertNotNull(reply);
    assertEquals(1, reply.getNumErrors());
    assertEquals(ErrorCode.SEQUENCE_ERROR, reply.getError(0).getCode());
    session.destroy();
    server.destroy();
    slobrok.stop();
}
Also used : SimpleProtocol(com.yahoo.messagebus.test.SimpleProtocol) Receptor(com.yahoo.messagebus.test.Receptor) RetryTransientErrorsPolicy(com.yahoo.messagebus.routing.RetryTransientErrorsPolicy) RPCNetworkParams(com.yahoo.messagebus.network.rpc.RPCNetworkParams) SimpleMessage(com.yahoo.messagebus.test.SimpleMessage) Slobrok(com.yahoo.jrt.slobrok.server.Slobrok) TestServer(com.yahoo.messagebus.network.rpc.test.TestServer) Test(org.junit.Test)

Aggregations

Slobrok (com.yahoo.jrt.slobrok.server.Slobrok)1 RPCNetworkParams (com.yahoo.messagebus.network.rpc.RPCNetworkParams)1 TestServer (com.yahoo.messagebus.network.rpc.test.TestServer)1 RetryTransientErrorsPolicy (com.yahoo.messagebus.routing.RetryTransientErrorsPolicy)1 Receptor (com.yahoo.messagebus.test.Receptor)1 SimpleMessage (com.yahoo.messagebus.test.SimpleMessage)1 SimpleProtocol (com.yahoo.messagebus.test.SimpleProtocol)1 Test (org.junit.Test)1