use of com.yahoo.messagebus.network.rpc.RPCNetworkParams in project vespa by vespa-engine.
the class SharedDestinationSessionTestCase method requireThatMbusIsReleasedOnDestroy.
@Test
public void requireThatMbusIsReleasedOnDestroy() {
Slobrok slobrok = null;
try {
slobrok = new Slobrok();
} catch (ListenFailedException e) {
fail();
}
RPCNetworkParams netParams = new RPCNetworkParams().setSlobrokConfigId(slobrok.configId());
SharedMessageBus mbus = SharedMessageBus.newInstance(new MessageBusParams(), netParams);
SharedDestinationSession session = mbus.newDestinationSession(new DestinationSessionParams());
mbus.release();
session.release();
assertFalse("MessageBus not destroyed by release().", mbus.messageBus().destroy());
}
use of com.yahoo.messagebus.network.rpc.RPCNetworkParams in project vespa by vespa-engine.
the class SharedDestinationSessionTestCase method newDestinationSession.
private static SharedDestinationSession newDestinationSession(String slobrokId, DestinationSessionParams params) {
RPCNetworkParams netParams = new RPCNetworkParams().setSlobrokConfigId(slobrokId);
MessageBusParams mbusParams = new MessageBusParams().addProtocol(new SimpleProtocol());
SharedMessageBus mbus = SharedMessageBus.newInstance(mbusParams, netParams);
SharedDestinationSession session = mbus.newDestinationSession(params);
mbus.release();
return session;
}
use of com.yahoo.messagebus.network.rpc.RPCNetworkParams in project vespa by vespa-engine.
the class SharedMessageBusTestCase method requireThatMbusIsClosedOnDestroy.
@Test
public void requireThatMbusIsClosedOnDestroy() throws ListenFailedException {
Slobrok slobrok = new Slobrok();
SharedMessageBus mbus = SharedMessageBus.newInstance(new MessageBusParams(), new RPCNetworkParams().setSlobrokConfigId(slobrok.configId()));
mbus.release();
assertFalse(mbus.messageBus().destroy());
}
use of com.yahoo.messagebus.network.rpc.RPCNetworkParams in project vespa by vespa-engine.
the class SharedIntermediateSessionTestCase method newIntermediateSession.
private static SharedIntermediateSession newIntermediateSession(String slobrokId, IntermediateSessionParams params) {
RPCNetworkParams netParams = new RPCNetworkParams().setSlobrokConfigId(slobrokId);
MessageBusParams mbusParams = new MessageBusParams().addProtocol(new SimpleProtocol());
SharedMessageBus mbus = SharedMessageBus.newInstance(mbusParams, netParams);
SharedIntermediateSession session = mbus.newIntermediateSession(params);
mbus.release();
return session;
}
use of com.yahoo.messagebus.network.rpc.RPCNetworkParams 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);
}
Aggregations