You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2010/10/08 13:30:40 UTC

[jira] Created: (CAMEL-3209) CXF-RS - Add throwExceptionOnFailure option

CXF-RS - Add throwExceptionOnFailure option
-------------------------------------------

                 Key: CAMEL-3209
                 URL: https://issues.apache.org/activemq/browse/CAMEL-3209
             Project: Apache Camel
          Issue Type: New Feature
          Components: camel-cxf
            Reporter: Claus Ibsen


See CAMEL-3184

Currently you will have to check the status code of the response if its != 200.


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


[jira] Commented: (CAMEL-3209) CXF-RS - Add throwExceptionOnFailure option

Posted by "Johan Edstrom (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-3209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62502#action_62502 ] 

Johan Edstrom commented on CAMEL-3209:
--------------------------------------

An idea for a patch is here.

http://github.com/seijoed/camel/commit/2b2e651731b4e1ea1a466ef271087a242da2b747

> CXF-RS - Add throwExceptionOnFailure option
> -------------------------------------------
>
>                 Key: CAMEL-3209
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3209
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-cxf
>            Reporter: Claus Ibsen
>
> See CAMEL-3184
> Currently you will have to check the status code of the response if its != 200.

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


Re: [jira] Commented: (CAMEL-3209) CXF-RS - Add throwExceptionOnFailure option

Posted by Johan Edstrom <se...@gmail.com>.
Thanks!

That was exactly what I wanted.
New patch coming tomorrow.

On Oct 11, 2010, at 11:20 PM, Claus Ibsen (JIRA) wrote:

> 
>    [ https://issues.apache.org/activemq/browse/CAMEL-3209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62510#action_62510 ] 
> 
> Claus Ibsen commented on CAMEL-3209:
> ------------------------------------
> 
> Ah great nice you are helping out. Be careful though if you help to much it gets noticed and we will invite you in :)
> 
> The thrown exception class should also contain the response body so end user can access it. It may contain some additional data.
> 
> In your patch you override the endpoint setting by the header because Camel will return false in case the header doesn't exist.
> You need to only fallback on the endpoint setting if the header is missing. And be careful not to change the endpoint setting with the value from the header.
> As there can be exchange which has NO headers and then they must use the correct endpoint setting, and not just the last value which was set by the previously process message.
> 
> You can look at camel-http which has such a feature, it may help. Also its nice when the components act in similar ways.
> 
>> CXF-RS - Add throwExceptionOnFailure option
>> -------------------------------------------
>> 
>>                Key: CAMEL-3209
>>                URL: https://issues.apache.org/activemq/browse/CAMEL-3209
>>            Project: Apache Camel
>>         Issue Type: New Feature
>>         Components: camel-cxf
>>           Reporter: Claus Ibsen
>> 
>> See CAMEL-3184
>> Currently you will have to check the status code of the response if its != 200.
> 
> -- 
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
> 

Johan Edstrom

joed@opennms.org

They that can give up essential liberty to purchase a little temporary safety, deserve neither liberty nor safety.

Benjamin Franklin, Historical Review of Pennsylvania, 1759






[jira] Commented: (CAMEL-3209) CXF-RS - Add throwExceptionOnFailure option

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-3209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62510#action_62510 ] 

Claus Ibsen commented on CAMEL-3209:
------------------------------------

Ah great nice you are helping out. Be careful though if you help to much it gets noticed and we will invite you in :)

The thrown exception class should also contain the response body so end user can access it. It may contain some additional data.

In your patch you override the endpoint setting by the header because Camel will return false in case the header doesn't exist.
You need to only fallback on the endpoint setting if the header is missing. And be careful not to change the endpoint setting with the value from the header.
As there can be exchange which has NO headers and then they must use the correct endpoint setting, and not just the last value which was set by the previously process message.

You can look at camel-http which has such a feature, it may help. Also its nice when the components act in similar ways.

> CXF-RS - Add throwExceptionOnFailure option
> -------------------------------------------
>
>                 Key: CAMEL-3209
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3209
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-cxf
>            Reporter: Claus Ibsen
>
> See CAMEL-3184
> Currently you will have to check the status code of the response if its != 200.

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


Re: [jira] Commented: (CAMEL-3209) CXF-RS - Add throwExceptionOnFailure option

Posted by Johan Edstrom <se...@gmail.com>.
I kept it false not to introduce anything new, simple to change and document.
And I think I forgot to include tests in the patch, I'll just redo it cleaned up.

Thanks!

I have tests for 

On Nov 9, 2010, at 12:44 AM, Claus Ibsen (JIRA) wrote:

> 
>    [ https://issues.apache.org/activemq/browse/CAMEL-3209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=63191#action_63191 ] 
> 
> Claus Ibsen commented on CAMEL-3209:
> ------------------------------------
> 
> Looks nice. Adding some unit test must be done :)
> 
> And there is one code comment which is off by one number
>> // Throw exception on non 201
> 
> It should be non 200 :)
> 
> I assume you have kept the option to false by default to keep backwards compatibility.
> I would prefer it was true as default as an exception will be thrown and the error handling of Camel can kick in.
> This will also make it similar to the http components.
> 
> Any thoughts of changing it to true as default?
> 
> 
>> CXF-RS - Add throwExceptionOnFailure option
>> -------------------------------------------
>> 
>>                Key: CAMEL-3209
>>                URL: https://issues.apache.org/activemq/browse/CAMEL-3209
>>            Project: Apache Camel
>>         Issue Type: New Feature
>>         Components: camel-cxf
>>           Reporter: Claus Ibsen
>>           Assignee: Johan Edstrom
>>            Fix For: 2.6.0
>> 
>>        Attachments: 0001-https-issues.apache.org-activemq-browse-CAMEL-3209.patch, 0002-https-issues.apache.org-activemq-browse-CAMEL-3209.patch, Camel____CXF_jax-rs_producer_exception.patch
>> 
>> 
>> See CAMEL-3184
>> Currently you will have to check the status code of the response if its != 200.
> 
> -- 
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
> 


[jira] Commented: (CAMEL-3209) CXF-RS - Add throwExceptionOnFailure option

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-3209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=63191#action_63191 ] 

Claus Ibsen commented on CAMEL-3209:
------------------------------------

Looks nice. Adding some unit test must be done :)

And there is one code comment which is off by one number
>  // Throw exception on non 201

It should be non 200 :)

I assume you have kept the option to false by default to keep backwards compatibility.
I would prefer it was true as default as an exception will be thrown and the error handling of Camel can kick in.
This will also make it similar to the http components.

Any thoughts of changing it to true as default?


> CXF-RS - Add throwExceptionOnFailure option
> -------------------------------------------
>
>                 Key: CAMEL-3209
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3209
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-cxf
>            Reporter: Claus Ibsen
>            Assignee: Johan Edstrom
>             Fix For: 2.6.0
>
>         Attachments: 0001-https-issues.apache.org-activemq-browse-CAMEL-3209.patch, 0002-https-issues.apache.org-activemq-browse-CAMEL-3209.patch, Camel____CXF_jax-rs_producer_exception.patch
>
>
> See CAMEL-3184
> Currently you will have to check the status code of the response if its != 200.

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


[jira] Commented: (CAMEL-3209) CXF-RS - Add throwExceptionOnFailure option

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-3209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=63490#action_63490 ] 

Claus Ibsen commented on CAMEL-3209:
------------------------------------

Johan can you point to the spec which says that status codes 201-206 is also OK ? 

The http components uses != 200 so I want it to be consistent between the different components

> CXF-RS - Add throwExceptionOnFailure option
> -------------------------------------------
>
>                 Key: CAMEL-3209
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3209
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-cxf
>            Reporter: Claus Ibsen
>            Assignee: Johan Edstrom
>             Fix For: 2.6.0
>
>         Attachments: 0001-https-issues.apache.org-activemq-browse-CAMEL-3209.patch, 0002-https-issues.apache.org-activemq-browse-CAMEL-3209.patch, Camel____CXF_jax-rs_producer_exception.patch
>
>
> See CAMEL-3184
> Currently you will have to check the status code of the response if its != 200.

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


[jira] Commented: (CAMEL-3209) CXF-RS - Add throwExceptionOnFailure option

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-3209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=63491#action_63491 ] 

Claus Ibsen commented on CAMEL-3209:
------------------------------------

Also please update the wiki documentation and add to release notes. Remember to add in release notes about important to consider when upgrading, that it now throws an exception in case of errors.

> CXF-RS - Add throwExceptionOnFailure option
> -------------------------------------------
>
>                 Key: CAMEL-3209
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3209
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-cxf
>            Reporter: Claus Ibsen
>            Assignee: Johan Edstrom
>             Fix For: 2.6.0
>
>         Attachments: 0001-https-issues.apache.org-activemq-browse-CAMEL-3209.patch, 0002-https-issues.apache.org-activemq-browse-CAMEL-3209.patch, Camel____CXF_jax-rs_producer_exception.patch
>
>
> See CAMEL-3184
> Currently you will have to check the status code of the response if its != 200.

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


[jira] Updated: (CAMEL-3209) CXF-RS - Add throwExceptionOnFailure option

Posted by "Johan Edstrom (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-3209?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Johan Edstrom updated CAMEL-3209:
---------------------------------

    Attachment: 0002-https-issues.apache.org-activemq-browse-CAMEL-3209.patch
                0001-https-issues.apache.org-activemq-browse-CAMEL-3209.patch

Second patch cleans up the first, adding exception handling and removes the header.

> CXF-RS - Add throwExceptionOnFailure option
> -------------------------------------------
>
>                 Key: CAMEL-3209
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3209
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-cxf
>            Reporter: Claus Ibsen
>         Attachments: 0001-https-issues.apache.org-activemq-browse-CAMEL-3209.patch, 0002-https-issues.apache.org-activemq-browse-CAMEL-3209.patch
>
>
> See CAMEL-3184
> Currently you will have to check the status code of the response if its != 200.

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


[jira] Updated: (CAMEL-3209) CXF-RS - Add throwExceptionOnFailure option

Posted by "Johan Edstrom (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-3209?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Johan Edstrom updated CAMEL-3209:
---------------------------------

    Attachment: Camel____CXF_jax-rs_producer_exception.patch

Cleaned up github stuff, right ASF license.

> CXF-RS - Add throwExceptionOnFailure option
> -------------------------------------------
>
>                 Key: CAMEL-3209
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3209
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-cxf
>            Reporter: Claus Ibsen
>            Assignee: Johan Edstrom
>             Fix For: 2.6.0
>
>         Attachments: 0001-https-issues.apache.org-activemq-browse-CAMEL-3209.patch, 0002-https-issues.apache.org-activemq-browse-CAMEL-3209.patch, Camel____CXF_jax-rs_producer_exception.patch
>
>
> See CAMEL-3184
> Currently you will have to check the status code of the response if its != 200.

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


[jira] Assigned: (CAMEL-3209) CXF-RS - Add throwExceptionOnFailure option

Posted by "Johan Edstrom (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-3209?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Johan Edstrom reassigned CAMEL-3209:
------------------------------------

    Assignee: Johan Edstrom

> CXF-RS - Add throwExceptionOnFailure option
> -------------------------------------------
>
>                 Key: CAMEL-3209
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3209
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-cxf
>            Reporter: Claus Ibsen
>            Assignee: Johan Edstrom
>             Fix For: 2.6.0
>
>         Attachments: 0001-https-issues.apache.org-activemq-browse-CAMEL-3209.patch, 0002-https-issues.apache.org-activemq-browse-CAMEL-3209.patch
>
>
> See CAMEL-3184
> Currently you will have to check the status code of the response if its != 200.

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


[jira] Resolved: (CAMEL-3209) CXF-RS - Add throwExceptionOnFailure option

Posted by "Johan Edstrom (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-3209?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Johan Edstrom resolved CAMEL-3209.
----------------------------------

    Resolution: Fixed

Debated and fixed per discussion with Claus.
Changed logic from  != 200 to > 207 per reading header spec docs.

Also not conflicting with existing tests.

Revision : r1038502

> CXF-RS - Add throwExceptionOnFailure option
> -------------------------------------------
>
>                 Key: CAMEL-3209
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3209
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-cxf
>            Reporter: Claus Ibsen
>            Assignee: Johan Edstrom
>             Fix For: 2.6.0
>
>         Attachments: 0001-https-issues.apache.org-activemq-browse-CAMEL-3209.patch, 0002-https-issues.apache.org-activemq-browse-CAMEL-3209.patch, Camel____CXF_jax-rs_producer_exception.patch
>
>
> See CAMEL-3184
> Currently you will have to check the status code of the response if its != 200.

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


[jira] Updated: (CAMEL-3209) CXF-RS - Add throwExceptionOnFailure option

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-3209?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-3209:
-------------------------------

    Fix Version/s: 2.6.0

> CXF-RS - Add throwExceptionOnFailure option
> -------------------------------------------
>
>                 Key: CAMEL-3209
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3209
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-cxf
>            Reporter: Claus Ibsen
>             Fix For: 2.6.0
>
>         Attachments: 0001-https-issues.apache.org-activemq-browse-CAMEL-3209.patch, 0002-https-issues.apache.org-activemq-browse-CAMEL-3209.patch
>
>
> See CAMEL-3184
> Currently you will have to check the status code of the response if its != 200.

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


[jira] Commented: (CAMEL-3209) CXF-RS - Add throwExceptionOnFailure option

Posted by "Johan Edstrom (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-3209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62512#action_62512 ] 

Johan Edstrom commented on CAMEL-3209:
--------------------------------------

Well, the first I can live with if you want me. :)

Yeah, that was my main reason for calling this a tentative bumble, should we make it look like Http? - I think that make sense.

The last one, I don't think I right away see that.


> CXF-RS - Add throwExceptionOnFailure option
> -------------------------------------------
>
>                 Key: CAMEL-3209
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3209
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-cxf
>            Reporter: Claus Ibsen
>
> See CAMEL-3184
> Currently you will have to check the status code of the response if its != 200.

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