use of org.apache.camel.processor.SendProcessor in project camel by apache.
the class AsyncEndpointRoutingSlipBeanNonBlockingTest method testAsyncEndpointDontBlock.
public void testAsyncEndpointDontBlock() throws Exception {
getMockEndpoint("mock:result").expectedBodiesReceived("Bye Camel");
Endpoint startEndpoint = context.getEndpoint("direct:start");
SendProcessor asyncSender = new SendProcessor(startEndpoint);
ServiceHelper.startService(asyncSender);
ExecutorService executorService = context.getExecutorServiceManager().newSingleThreadExecutor(this, "test");
try {
Future<Boolean> asyncFuture = executorService.submit(new ExchangeSubmitter(startEndpoint, asyncSender));
Assert.assertFalse(asyncFuture.get(5, TimeUnit.SECONDS));
innerExchange.getOut().setBody("Bye Camel");
innerCallback.done(false);
assertMockEndpointsSatisfied();
} finally {
executorService.shutdown();
ServiceHelper.stopAndShutdownService(asyncSender);
}
}
use of org.apache.camel.processor.SendProcessor in project camel by apache.
the class DeadLetterChannelBuilder method getFailureProcessor.
// Properties
// -------------------------------------------------------------------------
public Processor getFailureProcessor() {
if (failureProcessor == null) {
// wrap in our special safe fallback error handler if sending to dead letter channel fails
Processor child = new SendProcessor(deadLetter, ExchangePattern.InOnly);
// force MEP to be InOnly so when sending to DLQ we would not expect a reply if the MEP was InOut
failureProcessor = new FatalFallbackErrorHandler(child, true);
}
return failureProcessor;
}
Aggregations