You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Sven Bauhan <sv...@ast.dfs.de> on 2014/05/13 20:20:23 UTC

How to catch a DirectConsumerNotAvailableException?

Hi,

I have a route with a direct endpoint going to a socket connection. It 
can be the the program on the other side of the connection crashes and 
the connection is shut down. My messages in the route cannot be 
delivered any more. This happens especially from the aggregator in the 
route.

In the log file I can see that for each aggregated message a 
DirectConsumerNotAvailableException is thrown. Now I want to catch this 
exception to advise the Aggregator  to report an error to the sender of 
the message instead of a success message.

Do I have to catch the exception on the route or in the aggregator? How 
can I handle it in the Aggregator::onCompletion() method?

Thanks,
Sven


Re: How to catch a DirectConsumerNotAvailableException?

Posted by Sven Bauhan <sv...@ast.dfs.de>.
Now I managed to propagate the message to an inner route and catch it there.

But I don't know how to handle the good case.
If the message is send to the endpoint correctly, I have to reply with 
an acknowledge message.
But how does the inner route know if the message is transmitted 
correctly to the endpoint?

Thanks Sven

On 05/13/14 20:20, Sven Bauhan wrote:
> Hi,
>
> I have a route with a direct endpoint going to a socket connection. It 
> can be the the program on the other side of the connection crashes and 
> the connection is shut down. My messages in the route cannot be 
> delivered any more. This happens especially from the aggregator in the 
> route.
>
> In the log file I can see that for each aggregated message a 
> DirectConsumerNotAvailableException is thrown. Now I want to catch 
> this exception to advise the Aggregator  to report an error to the 
> sender of the message instead of a success message.
>
> Do I have to catch the exception on the route or in the aggregator? 
> How can I handle it in the Aggregator::onCompletion() method?
>
> Thanks,
> Sven
>
>
>