[jira] Created: (CAMEL-885) DefaultProducerTemplate.extractResultBody() should throw an exception if there was a failure rather than returning the input message

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

[jira] Created: (CAMEL-885) DefaultProducerTemplate.extractResultBody() should throw an exception if there was a failure rather than returning the input message

JIRA jira@apache.org
DefaultProducerTemplate.extractResultBody() should throw an exception if there was a failure rather than returning the input message
------------------------------------------------------------------------------------------------------------------------------------

                 Key: CAMEL-885
                 URL: https://issues.apache.org/activemq/browse/CAMEL-885
             Project: Apache Camel
          Issue Type: Bug
            Reporter: James Strachan
             Fix For: 1.5.0


we should throw an exception if there was a Fault or the exchange contains an Exception

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

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (CAMEL-885) DefaultProducerTemplate.extractResultBody() should throw an exception if there was a failure rather than returning the input message

JIRA jira@apache.org

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

Claus Ibsen updated CAMEL-885:
------------------------------

             Assignee: Claus Ibsen
    Affects Version/s: 1.4.0
             Priority: Critical  (was: Major)
          Component/s: camel-core

Indeed a stupid behavior in Camel. We should of course throw an exception if the exchange failed.

However this can break existing solutions that rely on the "old odd" behavior. We should document this in the release notes.

> DefaultProducerTemplate.extractResultBody() should throw an exception if there was a failure rather than returning the input message
> ------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-885
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-885
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 1.4.0
>            Reporter: James Strachan
>            Assignee: Claus Ibsen
>            Priority: Critical
>             Fix For: 1.5.0
>
>
> we should throw an exception if there was a Fault or the exchange contains an Exception

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-885) DefaultProducerTemplate.extractResultBody() should throw an exception if there was a failure rather than returning the input message

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Claus Ibsen commented on CAMEL-885:
-----------------------------------

All the methods doesn't have any exceptions declared to be thrown. I suggest to wrap the exception as a RuntimeCamelException with the caused exception.
Otherwise we need to add throws Exception to all methods.

We could check if the exception already is a runtime exception and throw it as is. Then *only* wrap the checked.

Any thoughts?

> DefaultProducerTemplate.extractResultBody() should throw an exception if there was a failure rather than returning the input message
> ------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-885
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-885
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 1.4.0
>            Reporter: James Strachan
>            Assignee: Claus Ibsen
>            Priority: Critical
>             Fix For: 1.5.0
>
>
> we should throw an exception if there was a Fault or the exchange contains an Exception

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

Reply | Threaded
Open this post in threaded view
|

[jira] Work started: (CAMEL-885) DefaultProducerTemplate.extractResultBody() should throw an exception if there was a failure rather than returning the input message

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Work on CAMEL-885 started by Claus Ibsen.

> DefaultProducerTemplate.extractResultBody() should throw an exception if there was a failure rather than returning the input message
> ------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-885
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-885
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 1.4.0
>            Reporter: James Strachan
>            Assignee: Claus Ibsen
>            Priority: Critical
>             Fix For: 1.5.0
>
>
> we should throw an exception if there was a Fault or the exchange contains an Exception

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-885) DefaultProducerTemplate.extractResultBody() should throw an exception if there was a failure rather than returning the input message

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Claus Ibsen commented on CAMEL-885:
-----------------------------------

We are gonna break some unit tests that relied on the old odd behaviour of not rethrowning any exception.

This is from testing camel-core

Tests run: 554, Failures: 27, Errors: 40, Skipped: 0

> DefaultProducerTemplate.extractResultBody() should throw an exception if there was a failure rather than returning the input message
> ------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-885
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-885
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 1.4.0
>            Reporter: James Strachan
>            Assignee: Claus Ibsen
>            Priority: Critical
>             Fix For: 1.5.0
>
>
> we should throw an exception if there was a Fault or the exchange contains an Exception

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-885) DefaultProducerTemplate.extractResultBody() should throw an exception if there was a failure rather than returning the input message

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Claus Ibsen commented on CAMEL-885:
-----------------------------------

Refined the extract method:

Tests in error:

Tests run: 554, Failures: 0, Errors: 39, Skipped: 0

> DefaultProducerTemplate.extractResultBody() should throw an exception if there was a failure rather than returning the input message
> ------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-885
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-885
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 1.4.0
>            Reporter: James Strachan
>            Assignee: Claus Ibsen
>            Priority: Critical
>             Fix For: 1.5.0
>
>
> we should throw an exception if there was a Fault or the exchange contains an Exception

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-885) DefaultProducerTemplate.extractResultBody() should throw an exception if there was a failure rather than returning the input message

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Claus Ibsen commented on CAMEL-885:
-----------------------------------

Okay this is just hard tedious work to refine the unit tests to handle that exceptions is now thrown from the template.sendBodyXXX methods.

16 unit tests to go in camel-core. Then there is just all the other components ;)

Tests run: 554, Failures: 0, Errors: 16, Skipped: 0

> DefaultProducerTemplate.extractResultBody() should throw an exception if there was a failure rather than returning the input message
> ------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-885
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-885
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 1.4.0
>            Reporter: James Strachan
>            Assignee: Claus Ibsen
>            Priority: Critical
>             Fix For: 1.5.0
>
>
> we should throw an exception if there was a Fault or the exchange contains an Exception

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-885) DefaultProducerTemplate.extractResultBody() should throw an exception if there was a failure rather than returning the input message

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Claus Ibsen commented on CAMEL-885:
-----------------------------------

Okay got camel-core fixed now. Just the rest ;)

> DefaultProducerTemplate.extractResultBody() should throw an exception if there was a failure rather than returning the input message
> ------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-885
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-885
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 1.4.0
>            Reporter: James Strachan
>            Assignee: Claus Ibsen
>            Priority: Critical
>             Fix For: 1.5.0
>
>
> we should throw an exception if there was a Fault or the exchange contains an Exception

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-885) DefaultProducerTemplate.extractResultBody() should throw an exception if there was a failure rather than returning the input message

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Claus Ibsen commented on CAMEL-885:
-----------------------------------

I am proposing this change
==========================
 - If exchange has exception then throw it (wrapped as RuntimeCamelException as the plain send method does).
 - If has FAULT message then return FAULT message
 - as before, return either IN/OUT based on exchange pattern



> DefaultProducerTemplate.extractResultBody() should throw an exception if there was a failure rather than returning the input message
> ------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-885
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-885
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 1.4.0
>            Reporter: James Strachan
>            Assignee: Claus Ibsen
>            Priority: Critical
>             Fix For: 1.5.0
>
>
> we should throw an exception if there was a Fault or the exchange contains an Exception

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

Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (CAMEL-885) DefaultProducerTemplate.extractResultBody() should throw an exception if there was a failure rather than returning the input message

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Claus Ibsen resolved CAMEL-885.
-------------------------------

    Resolution: Fixed

> DefaultProducerTemplate.extractResultBody() should throw an exception if there was a failure rather than returning the input message
> ------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-885
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-885
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 1.4.0
>            Reporter: James Strachan
>            Assignee: Claus Ibsen
>            Priority: Critical
>             Fix For: 1.5.0
>
>
> we should throw an exception if there was a Fault or the exchange contains an Exception

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