// should at least take 3 sec
mock.setMinimumResultWaitTime(3000);
// use our own template that has a higher thread pool than default camel that uses 5
final ExecutorService executor = Executors.newFixedThreadPool(10);
final ProducerTemplate pt = new DefaultProducerTemplate(context, executor);
// must start the template
pt.start();
final List<Future<Object>> replies = new ArrayList<Future<Object>>(20);
for (int i = 0; i < 20; i++) {
final Future<Object> out = pt.asyncRequestBody("disruptor:bar", "Message " + i);
replies.add(out);
}
assertMockEndpointsSatisfied();
assertEquals(20, replies.size());
for (int i = 0; i < 20; i++) {
final String out = (String)replies.get(i).get();
assertTrue(out.startsWith("Bye"));
}
pt.stop();
executor.shutdownNow();
}