use of com.yahoo.messagebus.network.rpc.RPCNetworkParams in project vespa by vespa-engine.
the class SessionCache method createSharedMessageBus.
private static SharedMessageBus createSharedMessageBus(final ContainerMbusConfig mbusConfig, final String slobrokConfigId, final String identity, Protocol protocol) {
final MessageBusParams mbusParams = new MessageBusParams().addProtocol(protocol);
final int maxPendingSize = DocumentUtil.calculateMaxPendingSize(mbusConfig.maxConcurrentFactor(), mbusConfig.documentExpansionFactor(), mbusConfig.containerCoreMemory());
logSystemInfo(mbusConfig, maxPendingSize);
mbusParams.setMaxPendingCount(mbusConfig.maxpendingcount());
mbusParams.setMaxPendingSize(maxPendingSize);
final RPCNetworkParams netParams = new RPCNetworkParams().setSlobrokConfigId(slobrokConfigId).setIdentity(new Identity(identity)).setListenPort(mbusConfig.port());
return SharedMessageBus.newInstance(mbusParams, netParams);
}
use of com.yahoo.messagebus.network.rpc.RPCNetworkParams in project vespa by vespa-engine.
the class SharedIntermediateSessionTestCase 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);
SharedIntermediateSession session = mbus.newIntermediateSession(new IntermediateSessionParams());
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 SharedSourceSessionTestCase 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);
SharedSourceSession session = mbus.newSourceSession(new SourceSessionParams());
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 SharedSourceSessionTestCase method newSourceSession.
private static SharedSourceSession newSourceSession(String slobrokId, SourceSessionParams params) {
RPCNetworkParams netParams = new RPCNetworkParams().setSlobrokConfigId(slobrokId);
MessageBusParams mbusParams = new MessageBusParams().addProtocol(new SimpleProtocol());
SharedMessageBus mbus = SharedMessageBus.newInstance(mbusParams, netParams);
SharedSourceSession session = mbus.newSourceSession(params);
mbus.release();
return session;
}
use of com.yahoo.messagebus.network.rpc.RPCNetworkParams in project vespa by vespa-engine.
the class ChokeTestCase 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()));
srcServer = new TestServer(new MessageBusParams().setRetryPolicy(null).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));
}
Aggregations