Search in sources :

Example 1 with Identity

use of com.yahoo.messagebus.network.Identity in project vespa by vespa-engine.

the class RoutingContextTestCase method setUp.

@Override
public void setUp() throws ListenFailedException, UnknownHostException {
    slobrok = new Slobrok();
    dstServer = new TestServer(new MessageBusParams().addProtocol(new SimpleProtocol()), new RPCNetworkParams().setIdentity(new Identity("dst")).setSlobrokConfigId(TestServer.getSlobrokConfig(slobrok)));
    dstSession = dstServer.mb.createDestinationSession(new DestinationSessionParams().setName("session").setMessageHandler(new Receptor()));
    srcServer = new TestServer(new MessageBusParams().setRetryPolicy(new RetryTransientErrorsPolicy().setBaseDelay(0)).addProtocol(new SimpleProtocol()), new RPCNetworkParams().setSlobrokConfigId(TestServer.getSlobrokConfig(slobrok)));
    srcSession = srcServer.mb.createSourceSession(new SourceSessionParams().setTimeout(600.0).setReplyHandler(new Receptor()));
    assertTrue(srcServer.waitSlobrok("dst/session", 1));
}
Also used : SimpleProtocol(com.yahoo.messagebus.test.SimpleProtocol) Receptor(com.yahoo.messagebus.test.Receptor) RPCNetworkParams(com.yahoo.messagebus.network.rpc.RPCNetworkParams) Slobrok(com.yahoo.jrt.slobrok.server.Slobrok) Identity(com.yahoo.messagebus.network.Identity) TestServer(com.yahoo.messagebus.network.rpc.test.TestServer)

Example 2 with Identity

use of com.yahoo.messagebus.network.Identity in project vespa by vespa-engine.

the class RoutingTestCase method setUp.

@Before
public void setUp() throws ListenFailedException, UnknownHostException {
    slobrok = new Slobrok();
    dstServer = new TestServer(new MessageBusParams().addProtocol(new SimpleProtocol()), new RPCNetworkParams().setIdentity(new Identity("dst")).setSlobrokConfigId(TestServer.getSlobrokConfig(slobrok)));
    dstSession = dstServer.mb.createDestinationSession(new DestinationSessionParams().setName("session").setMessageHandler(new Receptor()));
    retryPolicy = new RetryTransientErrorsPolicy();
    retryPolicy.setBaseDelay(0);
    srcServer = new TestServer(new MessageBusParams().setRetryPolicy(retryPolicy).addProtocol(new SimpleProtocol()), new RPCNetworkParams().setSlobrokConfigId(TestServer.getSlobrokConfig(slobrok)));
    srcSession = srcServer.mb.createSourceSession(new SourceSessionParams().setTimeout(600.0).setThrottlePolicy(null).setReplyHandler(new Receptor()));
    assertTrue(srcServer.waitSlobrok("dst/session", 1));
}
Also used : SimpleProtocol(com.yahoo.messagebus.test.SimpleProtocol) Receptor(com.yahoo.messagebus.test.Receptor) RPCNetworkParams(com.yahoo.messagebus.network.rpc.RPCNetworkParams) Slobrok(com.yahoo.jrt.slobrok.server.Slobrok) Identity(com.yahoo.messagebus.network.Identity) TestServer(com.yahoo.messagebus.network.rpc.test.TestServer) Before(org.junit.Before)

Example 3 with Identity

use of com.yahoo.messagebus.network.Identity in project vespa by vespa-engine.

the class ResenderTestCase method setUp.

@Override
public void setUp() throws ListenFailedException, UnknownHostException {
    slobrok = new Slobrok();
    dstServer = new TestServer(new MessageBusParams().addProtocol(new SimpleProtocol()), new RPCNetworkParams().setIdentity(new Identity("dst")).setSlobrokConfigId(TestServer.getSlobrokConfig(slobrok)));
    dstSession = dstServer.mb.createDestinationSession(new DestinationSessionParams().setName("session").setMessageHandler(new Receptor()));
    retryPolicy = new RetryTransientErrorsPolicy();
    retryPolicy.setBaseDelay(0);
    srcServer = new TestServer(new MessageBusParams().setRetryPolicy(retryPolicy).addProtocol(new SimpleProtocol()), new RPCNetworkParams().setSlobrokConfigId(TestServer.getSlobrokConfig(slobrok)));
    srcSession = srcServer.mb.createSourceSession(new SourceSessionParams().setTimeout(600.0).setReplyHandler(new Receptor()));
    assertTrue(srcServer.waitSlobrok("dst/session", 1));
}
Also used : SimpleProtocol(com.yahoo.messagebus.test.SimpleProtocol) Receptor(com.yahoo.messagebus.test.Receptor) RPCNetworkParams(com.yahoo.messagebus.network.rpc.RPCNetworkParams) Slobrok(com.yahoo.jrt.slobrok.server.Slobrok) Identity(com.yahoo.messagebus.network.Identity) TestServer(com.yahoo.messagebus.network.rpc.test.TestServer)

Example 4 with Identity

use of com.yahoo.messagebus.network.Identity in project vespa by vespa-engine.

the class AdvancedRoutingTestCase method setUp.

@Override
public void setUp() throws ListenFailedException, UnknownHostException {
    slobrok = new Slobrok();
    dstServer = new TestServer(new MessageBusParams().addProtocol(new SimpleProtocol()), new RPCNetworkParams().setIdentity(new Identity("dst")).setSlobrokConfigId(TestServer.getSlobrokConfig(slobrok)));
    dstFoo = dstServer.mb.createDestinationSession(new DestinationSessionParams().setName("foo").setMessageHandler(new Receptor()));
    dstBar = dstServer.mb.createDestinationSession(new DestinationSessionParams().setName("bar").setMessageHandler(new Receptor()));
    dstBaz = dstServer.mb.createDestinationSession(new DestinationSessionParams().setName("baz").setMessageHandler(new Receptor()));
    srcServer = new TestServer(new MessageBusParams().setRetryPolicy(new RetryTransientErrorsPolicy().setBaseDelay(0)).addProtocol(new SimpleProtocol()), new RPCNetworkParams().setSlobrokConfigId(TestServer.getSlobrokConfig(slobrok)));
    srcSession = srcServer.mb.createSourceSession(new SourceSessionParams().setTimeout(600.0).setReplyHandler(new Receptor()));
    assertTrue(srcServer.waitSlobrok("dst/*", 3));
}
Also used : SimpleProtocol(com.yahoo.messagebus.test.SimpleProtocol) Receptor(com.yahoo.messagebus.test.Receptor) RPCNetworkParams(com.yahoo.messagebus.network.rpc.RPCNetworkParams) Slobrok(com.yahoo.jrt.slobrok.server.Slobrok) Identity(com.yahoo.messagebus.network.Identity) TestServer(com.yahoo.messagebus.network.rpc.test.TestServer)

Example 5 with Identity

use of com.yahoo.messagebus.network.Identity in project vespa by vespa-engine.

the class DummyReceiver method init.

public void init() {
    MessageBusParams params = new MessageBusParams(new LoadTypeSet());
    params.setRPCNetworkParams(new RPCNetworkParams().setIdentity(new Identity(name)));
    params.setDocumentManagerConfigId("client");
    params.getMessageBusParams().setMaxPendingCount(maxPendingCount);
    params.getMessageBusParams().setMaxPendingSize(0);
    da = new MessageBusDocumentAccess(params);
    queue = (maxQueueTime < 0) ? new LinkedBlockingDeque<>() : new ThroughputLimitQueue<>(maxQueueTime);
    session = da.getMessageBus().createDestinationSession("default", true, this);
    executor = new ThreadPoolExecutor(threads, threads, 5, TimeUnit.SECONDS, queue, new DaemonThreadFactory());
    System.out.println("Registered listener at " + name + "/default with " + maxPendingCount + " max pending and sleep time of " + sleepTime);
}
Also used : LinkedBlockingDeque(java.util.concurrent.LinkedBlockingDeque) RPCNetworkParams(com.yahoo.messagebus.network.rpc.RPCNetworkParams) MessageBusDocumentAccess(com.yahoo.documentapi.messagebus.MessageBusDocumentAccess) DaemonThreadFactory(com.yahoo.concurrent.DaemonThreadFactory) MessageBusParams(com.yahoo.documentapi.messagebus.MessageBusParams) ThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor) Identity(com.yahoo.messagebus.network.Identity) ThroughputLimitQueue(com.yahoo.documentapi.ThroughputLimitQueue) LoadTypeSet(com.yahoo.documentapi.messagebus.loadtypes.LoadTypeSet)

Aggregations

Identity (com.yahoo.messagebus.network.Identity)15 Slobrok (com.yahoo.jrt.slobrok.server.Slobrok)12 RPCNetworkParams (com.yahoo.messagebus.network.rpc.RPCNetworkParams)10 TestServer (com.yahoo.messagebus.network.rpc.test.TestServer)9 Receptor (com.yahoo.messagebus.test.Receptor)9 SimpleProtocol (com.yahoo.messagebus.test.SimpleProtocol)7 Before (org.junit.Before)4 MessageBusDocumentAccess (com.yahoo.documentapi.messagebus.MessageBusDocumentAccess)3 MessageBusParams (com.yahoo.documentapi.messagebus.MessageBusParams)3 LoadTypeSet (com.yahoo.documentapi.messagebus.loadtypes.LoadTypeSet)2 Spec (com.yahoo.jrt.Spec)2 DaemonThreadFactory (com.yahoo.concurrent.DaemonThreadFactory)1 DocumentTypeManager (com.yahoo.document.DocumentTypeManager)1 ThroughputLimitQueue (com.yahoo.documentapi.ThroughputLimitQueue)1 VisitorControlHandler (com.yahoo.documentapi.VisitorControlHandler)1 VisitorDataHandler (com.yahoo.documentapi.VisitorDataHandler)1 VisitorDestinationParameters (com.yahoo.documentapi.VisitorDestinationParameters)1 DocumentProtocol (com.yahoo.documentapi.messagebus.protocol.DocumentProtocol)1 SourceSessionParams (com.yahoo.messagebus.SourceSessionParams)1 SimpleMessage (com.yahoo.messagebus.test.SimpleMessage)1