camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ravi.4indra" <>
Subject Re: Camel Timeout on a route
Date Fri, 26 Oct 2012 19:43:29 GMT
Hi Raul,

can you please provide your inputs on the below piece of code. 

This method the uses the producer template asyncCallback to call the
commonRoute.and i used the future handle to get the response.

  public void getDataUsingProducerTemplate(Exchange exchange) throws
TimeoutException, InterruptedException, ExecutionException {
    	ProducerTemplate template = camelContext.createProducerTemplate();
    	Future<Exchange> future = template.asyncCallback("direct:commonRoute",
exchange, new  SynchronizationImpl());
    	// Retrieve the reply from the main thread, specifying a timeout
    	try {
			future.get(2, TimeUnit.SECONDS);
		}catch (TimeoutException e) {
			throw e;			

Without the thread sleep my global exception handler (On Exception) is not
able to catch the exception.


View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message