[jira] Created: (CAMEL-961) Reporting exceptions back to the jms requester in in-out exchange style

View: New views
12 Messages — Rating Filter:   Alert me  

[jira] Created: (CAMEL-961) Reporting exceptions back to the jms requester in in-out exchange style

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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
         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.


[jira] Assigned: (CAMEL-961) Reporting exceptions back to the jms requester in in-out exchange style

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ https://issues.apache.org/activemq/browse/CAMEL-961?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hadrian Zbarcea reassigned CAMEL-961:
-------------------------------------

    Assignee: Hadrian Zbarcea

> 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.


[jira] Issue Comment Edited: (CAMEL-961) Reporting exceptions back to the jms requester in in-out exchange style

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

hadrian edited comment on CAMEL-961 at 10/9/08 6:47 PM:
----------------------------------------------------------------

Thanks for the test case!  We highly appreciate when an issue is accompanied by code that demonstrates it.  Makes our lives easier, and you'll get your issue resolved much faster.

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?

      was (Author: hadrian):
    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.


[jira] Commented: (CAMEL-961) Reporting exceptions back to the jms requester in in-out exchange style

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ 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.


[jira] Commented: (CAMEL-961) Reporting exceptions back to the jms requester in in-out exchange style

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

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

Can we close this one with a "won't fix"?

> 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.


[jira] Issue Comment Edited: (CAMEL-961) Reporting exceptions back to the jms requester in in-out exchange style

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

hadrian edited comment on CAMEL-961 at 10/9/08 10:16 PM:
-----------------------------------------------------------------

Can we close this one with a "won't fix"?

@Markus, I think CAMEL-960 will solve your problem.

      was (Author: hadrian):
    Can we close this one with a "won't fix"?
 

> 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.


[jira] Commented: (CAMEL-961) Reporting exceptions back to the jms requester in in-out exchange style

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

Markus Wolf commented on CAMEL-961:
-----------------------------------

No, it's not the same, and CAMEL-960 won't fix our problem.
To be more specific, we tried to setup an InOut-Exchange using JMS as transport. If during the processing with camel an exception is thrown, then on the client side (which started the request) there is only a timeout. No way to identify what when wrong.

In our specific case the dead letter queue should catch some of the exceptions and do exception handling, while others should be reported back to the client to be handled there.

> 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.


[jira] Commented: (CAMEL-961) Reporting exceptions back to the jms requester in in-out exchange style

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

Claus Ibsen commented on CAMEL-961:
-----------------------------------

Exceptions or Exchange objects is not propagated over the JMS wire, only payload and primitive headers.
The JMS spec is somewhat limitied what can be sent.

Are you using Camel on the client side as well?

If for instance the Exchange is sent over the wire as ObjectMessage then it requires that you have the same .class on the classpath on both the client and server side. And currently we do not have a eg. camel-jms-client.jar etc. or camel-client.jar.

What kind of response do you want to be returned when there has been a failure?

I will check if I can find the other related tickets on this issue.


> 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.


[jira] Commented: (CAMEL-961) Reporting exceptions back to the jms requester in in-out exchange style

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

Markus Wolf commented on CAMEL-961:
-----------------------------------

I'm new to JMS so I'm  not aware that there is no reliable way to transfer an error or do any error reporting at all. It seems that there are the same limitations like in RMI (all classes on both sides...).

First I've tried to set a fault on the exchange and realized with JMS this is silently dropped in camel. It would be good to issue a warning on this. Or IMHO to convert the fault to an out body and set a header. Then on the client side let the camel Exchange.isFault return true in this case.
The exception must not be there and deserializable, but it would be good to have at least an error message or stacktrace as string. So the client could realize the error and maybe handle or output it to the user.

> 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.


[jira] Commented: (CAMEL-961) Reporting exceptions back to the jms requester in in-out exchange style

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

Claus Ibsen commented on CAMEL-961:
-----------------------------------

Also if sending objects back over the JMS wire they must be serializable, but yet again exceptions tend to be that. But if you want to send an Exchange object back populated with payload, then the payload itself also must be serializable.

> 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.


[jira] Commented: (CAMEL-961) Reporting exceptions back to the jms requester in in-out exchange style

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

Markus Wolf commented on CAMEL-961:
-----------------------------------

Oh, thats already discussed in the related bugs...

> 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.


[jira] Commented: (CAMEL-961) Reporting exceptions back to the jms requester in in-out exchange style

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

Claus Ibsen commented on CAMEL-961:
-----------------------------------

Markus could you try 1.5-SNAPSHOT as CAMEL-585 added support of returning FAULT messages in the camel jms consumer. So it should not silently be dropped.

> 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.

LightInTheBox - Buy quality products at wholesale price!
Need professional support or training for Apache Camel? Graphic Design by Hiram and the Nabble Forum configured by James