use of net.dempsy.transport.blockingqueue.BlockingQueueReceiver in project Dempsy by Dempsy.
the class TestContainer method addOutputCatchStage.
public NodeManager addOutputCatchStage() throws InterruptedException {
// =======================================================
// configure an output catcher tier
final Node out = new Node("test-app").defaultRoutingStrategyId("net.dempsy.router.simple").receiver(new BlockingQueueReceiver(new ArrayBlockingQueue<>(16))).setNodeStatsCollector(// same app as the spring file.
new BasicNodeStatsCollector());
out.cluster("output-catch").mp(new MessageProcessor<OutputCatcher>(new OutputCatcher()));
out.validate();
final NodeManager nman = track(new NodeManager()).node(out).collaborator(track(sessionFactory.createSession())).start();
// wait until we can actually reach the output-catch cluster from the main node
assertTrue(poll(o -> {
try {
return canReach(getRouter(manager), "output-catch", new KeyExtractor().extract(new OutputMessage("foo", 1, 1)).iterator().next());
} catch (final Exception e) {
return false;
}
}));
// =======================================================
return nman;
}
Aggregations