Search in sources :

Example 11 with SourceSessionParams

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);
}
Also used : MockFeedReaderFactory(com.yahoo.vespaxmlparser.MockFeedReaderFactory) DocumentApiMetrics(com.yahoo.documentapi.metrics.DocumentApiMetrics) InputStream(java.io.InputStream) SourceSessionParams(com.yahoo.messagebus.SourceSessionParams) Before(org.junit.Before)

Example 12 with SourceSessionParams

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());
}
Also used : MessageBusDocumentAccess(com.yahoo.documentapi.messagebus.MessageBusDocumentAccess) Slobrok(com.yahoo.jrt.slobrok.server.Slobrok) MessageBusParams(com.yahoo.documentapi.messagebus.MessageBusParams) Identity(com.yahoo.messagebus.network.Identity) SourceSessionParams(com.yahoo.messagebus.SourceSessionParams) Before(org.junit.Before)

Example 13 with SourceSessionParams

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());
}
Also used : RPCNetworkParams(com.yahoo.messagebus.network.rpc.RPCNetworkParams) Slobrok(com.yahoo.jrt.slobrok.server.Slobrok) MessageBusParams(com.yahoo.messagebus.MessageBusParams) SourceSessionParams(com.yahoo.messagebus.SourceSessionParams) ListenFailedException(com.yahoo.jrt.ListenFailedException) Test(org.junit.Test)

Aggregations

SourceSessionParams (com.yahoo.messagebus.SourceSessionParams)13 Test (org.junit.Test)5 SharedSourceSession (com.yahoo.messagebus.shared.SharedSourceSession)3 SessionCache (com.yahoo.container.jdisc.messagebus.SessionCache)2 DocumentApiMetrics (com.yahoo.documentapi.metrics.DocumentApiMetrics)2 Slobrok (com.yahoo.jrt.slobrok.server.Slobrok)2 MessageBusParams (com.yahoo.messagebus.MessageBusParams)2 Before (org.junit.Before)2 Splitter (com.google.common.base.Splitter)1 Pair (com.yahoo.collections.Pair)1 ComponentId (com.yahoo.component.ComponentId)1 ComponentRegistry (com.yahoo.component.provider.ComponentRegistry)1 ContainerDocumentConfig (com.yahoo.container.core.document.ContainerDocumentConfig)1 HttpRequest (com.yahoo.container.jdisc.HttpRequest)1 HttpResponse (com.yahoo.container.jdisc.HttpResponse)1 MbusServerProvider (com.yahoo.container.jdisc.messagebus.MbusServerProvider)1 SourceSessionKey (com.yahoo.container.jdisc.messagebus.SessionCache.SourceSessionKey)1 AccessLog (com.yahoo.container.logging.AccessLog)1 CallStack (com.yahoo.docproc.CallStack)1 DocprocService (com.yahoo.docproc.DocprocService)1