catch exception in camel

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

catch exception in camel

Ishada
errorHandler(deadLetterChannel("file:somelocation");

            from("jms:queuwlocation").to(
                    "file:someLocation");

I have read that camel error handling comes when there's a processing between two nodes, such as Processor, Predicate etc. But what if I cannot consume the message, in my case the camel cannot connect to jms. How should I log this exception ?. As I am trying to use a deadLetterChannel to send the message to filesystem, but since I have not received the message there is nothing new on the file location. how should I encounter this type of situation?
Reply | Threaded
Open this post in threaded view
|

Re: catch exception in camel

astefanutti
The component would generally do the logging for you while trying to recover from the error.

As for the JMS component specifically, it exposes a couple of options to configure error handling that you can use, namely:

exceptionListener, errorHandler, errorHandlerLoggingLevel, errorHandlerLogStackTrace

You can configure as well the interval between to recovery attempt with the 'recoveryInterval' option.

See http://camel.apache.org/jms.html#JMS-Alltheotheroptions

> On 17 Nov 2015, at 10:13, Ishada <[hidden email]> wrote:
>
> errorHandler(deadLetterChannel("file:somelocation");
>
>            from("jms:queuwlocation").to(
>                    "file:someLocation");
>
> I have read that camel error handling comes when there's a processing
> between two nodes, such as Processor, Predicate etc. But what if I cannot
> consume the message, in my case the camel cannot connect to jms. How should
> I log this exception ?. As I am trying to use a deadLetterChannel to send
> the message to filesystem, but since I have not received the message there
> is nothing new on the file location. how should I encounter this type of
> situation?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/catch-exception-in-camel-tp5773978.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: catch exception in camel

souciance
In reply to this post by Ishada
You reported this on stackoverflow. Please provide your code to help you out more and what errors you get.