camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sven Bauhan <s...@ast.dfs.de>
Subject Re: How to implement AsyncCallback for AsyncProcessor?
Date Mon, 02 May 2016 12:07:28 GMT
On 05/02/16 13:57, Claus Ibsen wrote:
> On Mon, May 2, 2016 at 1:54 PM, Sven Bauhan <sven.bauhan@ast.dfs.de> wrote:
>> I have context component to implement a protocol in our company.
>>
>> As the success of a transmission depends a response from the receiver, it
>> has to be handled asynchronously.
>>
>> Now I try to find a way to propagate a timeout exception, if no response is
>> received, out of the context component into the calling application route.
>>
> What whatever you have that triggers the timeout would then set an
> exception on the exchange and call the done(false) method on the async
> callback.
>
> Camel has a ExchangeTimeoutException you can use.
>
For example: exchng.setException(new MessageSendException());

I tried already, but it did not work yet.

Is there an example implementation for something like this?
How to use the ExchangeTimeoutException? Can I combine it with an 
aggregator?


Mime
View raw message