[ 
https://issues.apache.org/activemq/browse/CAMEL-961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46299#action_46299
 ] 

Hadrian Zbarcea commented on CAMEL-961:
---------------------------------------

I looked into this and made a couple of minor fixes but essentially all's the 
same.  I don't really see a problem with the code, so let's see if I understand 
your issue properly.

There is a test: org.apache.camel.builder.ExceptionBuilderTest already in the 
trunk that is very similar to your test.  The only significant difference is 
that in that test the onException() clause is followed by an alternate route, 
which I assume is what you intend to do (please see 
http://cwiki.apache.org/confluence/display/CAMEL/Exception+Clause).

I am a bit thrown off by the statement that "IOException should be returned to 
the jms:someQueue endpoint as answer to the request".  from() specifies the url 
where a consumer would consume from, so returning something (especially with a 
polling consumer) won't mean much.  The consumer creates an exchange that is 
passed down to the route to be handled.  If an error arises the error handler 
is invoked no matter what (and you want it that way).  What I understand you 
saying is that for some exceptions you need an alternate way of processing and 
exception() (well, that's deprecated, onException()) provides you the means to 
do just that.  

What exactly do you want to happen if an IOException gets thrown?  Am I missing 
something?

> Reporting exceptions back to the jms requester in in-out exchange style
> -----------------------------------------------------------------------
>
>                 Key: CAMEL-961
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-961
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-jms
>    Affects Versions: 1.4.0
>            Reporter: Markus Wolf
>            Assignee: Hadrian Zbarcea
>         Attachments: camel-test.tar.gz
>
>
> We tried to setup a route where some exceptions where caught by the dead 
> letter queue for retry and some exceptions where reported back to the jms 
> message requester in an in-out exchange style request.
> There are two problems with this.
> First: The dead letter queue is an all or nothing handler. There is currently 
> no way to give some excludes to the handled exceptions.
> Second: Exceptions are not serialized and returned by the jms listener on 
> reponse, but instead a camel runtime exception is logged and the jms request 
> thread gets a timeout.
> In the attached example the IOException should be returned to the 
> jms:someQueue endpoint as answer to the request. All other exceptions should 
> be handled by the dead letter queue.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to