use of com.yahoo.messagebus.SourceSessionParams in project vespa by vespa-engine.
the class V3CongestionTestCase method setup.
@Before
public void setup() {
// Set up a request to be used from the tests.
InputStream in = new MetaStream(new byte[] { 1 });
request = HttpRequest.createTestRequest("http://foo.bar:19020/reserved-for-internal-use/feedapi", com.yahoo.jdisc.http.HttpRequest.Method.POST, in);
request.getJDiscRequest().headers().add(Headers.VERSION, "3");
request.getJDiscRequest().headers().add(Headers.CLIENT_ID, "clientId");
// Create a mock that does not parse the message, only reads the rest of the line. Makes it easier
// to write tests. It uses a mock for message bus.
clientFeederV3 = new ClientFeederWithMocks(retainMockSession(new SourceSessionParams(), requests), new MockFeedReaderFactory(), null, /*DocTypeManager*/
"clientID", null, /*metric*/
new FeedReplyReader(null, /*metric*/
new DocumentApiMetrics(MetricReceiver.nullImplementation, "tester")), threadsAvail);
}
use of com.yahoo.messagebus.SourceSessionParams in project vespa by vespa-engine.
the class MessageBusDocumentApiTestCase method setUp.
@Before
public void setUp() throws ListenFailedException {
slobrok = new Slobrok();
String slobrokConfigId = "raw:slobrok[1]\n" + "slobrok[0].connectionspec tcp/localhost:" + slobrok.port() + "\n";
MessageBusParams params = new MessageBusParams();
params.getRPCNetworkParams().setIdentity(new Identity("test/feeder"));
params.getRPCNetworkParams().setSlobrokConfigId(slobrokConfigId);
params.setDocumentManagerConfigId("file:src/test/cfg/documentmanager.cfg");
params.setRouteName("Route");
params.setRoutingConfigId("file:src/test/cfg/messagebus.cfg");
params.setTraceLevel(9);
params.setSourceSessionParams(new SourceSessionParams().setThrottlePolicy(null));
access = new MessageBusDocumentAccess(params);
destination = new VisitableDestination(slobrokConfigId, params.getDocumentManagerConfigId());
}
use of com.yahoo.messagebus.SourceSessionParams 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());
}
Aggregations