[jira] Created: (CAMEL-1083) camel-http - should store content of response for http errors

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

[jira] Created: (CAMEL-1083) camel-http - should store content of response for http errors

JIRA jira@apache.org
camel-http - should store content of response for http errors
-------------------------------------------------------------

                 Key: CAMEL-1083
                 URL: https://issues.apache.org/activemq/browse/CAMEL-1083
             Project: Apache Camel
          Issue Type: Improvement
          Components: camel-http
    Affects Versions: 1.5.0, 1.4.0
            Reporter: Claus Ibsen
             Fix For: 1.5.1, 2.0.0


Currently we do not store the content if there was a eg HTTP error 500 returned. But throw a HttpOperationFailedException.

We should store the content also so end-users have access to this one as well. Maybe add some strategy methods on the HttpProducer so end users can override this class and create their own implementation.

See nabble:
http://www.nabble.com/HttpProducer%3A-how-to-access-the-body-of-an-error-page-i-td20475651s22882.html

--
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-1083) camel-http - should store content of response for http errors

JIRA jira@apache.org

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

Claus Ibsen updated CAMEL-1083:
-------------------------------

    Affects Version/s:     (was: 1.4.0)

You can get the error content in Camel 1.4.0

> camel-http - should store content of response for http errors
> -------------------------------------------------------------
>
>                 Key: CAMEL-1083
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1083
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-http
>    Affects Versions: 1.5.0
>            Reporter: Claus Ibsen
>             Fix For: 1.5.1, 2.0.0
>
>
> Currently we do not store the content if there was a eg HTTP error 500 returned. But throw a HttpOperationFailedException.
> We should store the content also so end-users have access to this one as well. Maybe add some strategy methods on the HttpProducer so end users can override this class and create their own implementation.
> See nabble:
> http://www.nabble.com/HttpProducer%3A-how-to-access-the-body-of-an-error-page-i-td20475651s22882.html

--
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] Assigned: (CAMEL-1083) camel-http - should store content of response for http errors

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

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

Claus Ibsen reassigned CAMEL-1083:
----------------------------------

    Assignee: Claus Ibsen

> camel-http - should store content of response for http errors
> -------------------------------------------------------------
>
>                 Key: CAMEL-1083
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1083
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-http
>    Affects Versions: 1.5.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 1.5.1, 2.0.0
>
>
> Currently we do not store the content if there was a eg HTTP error 500 returned. But throw a HttpOperationFailedException.
> We should store the content also so end-users have access to this one as well. Maybe add some strategy methods on the HttpProducer so end users can override this class and create their own implementation.
> See nabble:
> http://www.nabble.com/HttpProducer%3A-how-to-access-the-body-of-an-error-page-i-td20475651s22882.html

--
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-1083) camel-http - should store content of response for http errors

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

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

Claus Ibsen updated CAMEL-1083:
-------------------------------

    Attachment: camel_1083.patch

A patch with a fix. Would like review by fellow committers

> camel-http - should store content of response for http errors
> -------------------------------------------------------------
>
>                 Key: CAMEL-1083
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1083
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-http
>    Affects Versions: 1.5.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 1.5.1, 2.0.0
>
>         Attachments: camel_1083.patch
>
>
> Currently we do not store the content if there was a eg HTTP error 500 returned. But throw a HttpOperationFailedException.
> We should store the content also so end-users have access to this one as well. Maybe add some strategy methods on the HttpProducer so end users can override this class and create their own implementation.
> See nabble:
> http://www.nabble.com/HttpProducer%3A-how-to-access-the-body-of-an-error-page-i-td20475651s22882.html

--
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-1083) camel-http - should store content of response for http errors

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

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

Claus Ibsen commented on CAMEL-1083:
------------------------------------

The patch also fixes CAMEL-1093.

To review:
- in case of exception should we return response code 500
- should we write the exception message and exception stracktrace as response body
- do we need a convient methods response body as string on the HttpOperationFailedException

> camel-http - should store content of response for http errors
> -------------------------------------------------------------
>
>                 Key: CAMEL-1083
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1083
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-http
>    Affects Versions: 1.5.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 1.5.1, 2.0.0
>
>         Attachments: camel_1083.patch
>
>
> Currently we do not store the content if there was a eg HTTP error 500 returned. But throw a HttpOperationFailedException.
> We should store the content also so end-users have access to this one as well. Maybe add some strategy methods on the HttpProducer so end users can override this class and create their own implementation.
> See nabble:
> http://www.nabble.com/HttpProducer%3A-how-to-access-the-body-of-an-error-page-i-td20475651s22882.html

--
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-1083) camel-http - should store content of response for http errors

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

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

Willem Jiang commented on CAMEL-1083:
-------------------------------------

Hi Claus

I reviewed your patch, I think it is necessary for us to send the camel router's internal's error back.
But I didn't find any the strategy methods in the HTTPProducer to override the implmentation of error content store.

Do you plan to address it in this JIRA ?

Cheers,

Willem


> camel-http - should store content of response for http errors
> -------------------------------------------------------------
>
>                 Key: CAMEL-1083
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1083
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-http
>    Affects Versions: 1.5.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 1.5.1, 2.0.0
>
>         Attachments: camel_1083.patch
>
>
> Currently we do not store the content if there was a eg HTTP error 500 returned. But throw a HttpOperationFailedException.
> We should store the content also so end-users have access to this one as well. Maybe add some strategy methods on the HttpProducer so end users can override this class and create their own implementation.
> See nabble:
> http://www.nabble.com/HttpProducer%3A-how-to-access-the-body-of-an-error-page-i-td20475651s22882.html

--
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-1083) camel-http - should store content of response for http errors

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

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

Claus Ibsen commented on CAMEL-1083:
------------------------------------

@Willem

Well spotted, I will add the strategy method so end users can customize this behavior.

I was wondering if the current behavior to return the exception as:
MESSAGE
STACKTRACE

Maybe should just be a plain
STACKTRACE



> camel-http - should store content of response for http errors
> -------------------------------------------------------------
>
>                 Key: CAMEL-1083
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1083
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-http
>    Affects Versions: 1.5.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 1.5.1, 2.0.0
>
>         Attachments: camel_1083.patch
>
>
> Currently we do not store the content if there was a eg HTTP error 500 returned. But throw a HttpOperationFailedException.
> We should store the content also so end-users have access to this one as well. Maybe add some strategy methods on the HttpProducer so end users can override this class and create their own implementation.
> See nabble:
> http://www.nabble.com/HttpProducer%3A-how-to-access-the-body-of-an-error-page-i-td20475651s22882.html

--
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-1083) camel-http - should store content of response for http errors

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

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

Willem Jiang commented on CAMEL-1083:
-------------------------------------

@Claus,

I think the plain STACKTRACE should be OK.
HTTP is a kind of request-reply communication , the client should already know what he send out.

> camel-http - should store content of response for http errors
> -------------------------------------------------------------
>
>                 Key: CAMEL-1083
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1083
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-http
>    Affects Versions: 1.5.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 1.5.1, 2.0.0
>
>         Attachments: camel_1083.patch
>
>
> Currently we do not store the content if there was a eg HTTP error 500 returned. But throw a HttpOperationFailedException.
> We should store the content also so end-users have access to this one as well. Maybe add some strategy methods on the HttpProducer so end users can override this class and create their own implementation.
> See nabble:
> http://www.nabble.com/HttpProducer%3A-how-to-access-the-body-of-an-error-page-i-td20475651s22882.html

--
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-1083) camel-http - should store content of response for http errors

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

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

Work on CAMEL-1083 started by Claus Ibsen.

> camel-http - should store content of response for http errors
> -------------------------------------------------------------
>
>                 Key: CAMEL-1083
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1083
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-http
>    Affects Versions: 1.5.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 1.5.1, 2.0.0
>
>         Attachments: camel_1083.patch
>
>
> Currently we do not store the content if there was a eg HTTP error 500 returned. But throw a HttpOperationFailedException.
> We should store the content also so end-users have access to this one as well. Maybe add some strategy methods on the HttpProducer so end users can override this class and create their own implementation.
> See nabble:
> http://www.nabble.com/HttpProducer%3A-how-to-access-the-body-of-an-error-page-i-td20475651s22882.html

--
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-1083) camel-http - should store content of response for http errors

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

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

Claus Ibsen commented on CAMEL-1083:
------------------------------------

CAMEL-1107, CAMEL-1083, CAMEL-1095, CAMEL-1093: Major improvements to camel-jetty and camel-http.
camel-jetty: Now properly returns fault and exception
camel-http: repsonse body is avaiable on HttpOperationFailedException
camel-jetty: introduce HttpBinding as interface and to be referenced in Registry for end users to customize how response should be written
camel-jetty: now returns content-type and content-length if possible to calculate
both: minor URI parsing so internal Camel options is not exposed


Adding         components\camel-http\src\main\java\org\apache\camel\component\http\DefaultHttpBinding.java
Replacing      components\camel-http\src\main\java\org\apache\camel\component\http\HttpBinding.java
Sending        components\camel-http\src\main\java\org\apache\camel\component\http\HttpComponent.java
Sending        components\camel-http\src\main\java\org\apache\camel\component\http\HttpEndpoint.java
Sending        components\camel-http\src\main\java\org\apache\camel\component\http\HttpMessage.java
Sending        components\camel-http\src\main\java\org\apache\camel\component\http\HttpOperationFailedException.java
Sending        components\camel-http\src\main\java\org\apache\camel\component\http\HttpProducer.java
Sending        components\camel-jetty\src\main\java\org\apache\camel\component\jetty\JettyHttpComponent.java
Adding         components\camel-jetty\src\test\data
Adding  (bin)  components\camel-jetty\src\test\data\logo.jpeg
Adding         components\camel-jetty\src\test\java\org\apache\camel\component\jetty\JettyContentTypeTest.java
Adding         components\camel-jetty\src\test\java\org\apache\camel\component\jetty\JettyHttpBindingRefTest.java
Adding         components\camel-jetty\src\test\java\org\apache\camel\component\jetty\JettyHttpClientOptionsTest.java
Adding         components\camel-jetty\src\test\java\org\apache\camel\component\jetty\JettyImageFileTest.java
Adding         components\camel-jetty\src\test\java\org\apache\camel\component\jetty\JettyResponseBodyWhenErrorTest.java
Transmitting file data ..............
Committed revision 719662.

> camel-http - should store content of response for http errors
> -------------------------------------------------------------
>
>                 Key: CAMEL-1083
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1083
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-http
>    Affects Versions: 1.5.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 1.5.1, 2.0.0
>
>         Attachments: camel_1083.patch
>
>
> Currently we do not store the content if there was a eg HTTP error 500 returned. But throw a HttpOperationFailedException.
> We should store the content also so end-users have access to this one as well. Maybe add some strategy methods on the HttpProducer so end users can override this class and create their own implementation.
> See nabble:
> http://www.nabble.com/HttpProducer%3A-how-to-access-the-body-of-an-error-page-i-td20475651s22882.html

--
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-1083) camel-http - should store content of response for http errors

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

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

Claus Ibsen commented on CAMEL-1083:
------------------------------------

Wiki updated

> camel-http - should store content of response for http errors
> -------------------------------------------------------------
>
>                 Key: CAMEL-1083
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1083
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-http
>    Affects Versions: 1.5.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 1.5.1, 2.0.0
>
>         Attachments: camel_1083.patch
>
>
> Currently we do not store the content if there was a eg HTTP error 500 returned. But throw a HttpOperationFailedException.
> We should store the content also so end-users have access to this one as well. Maybe add some strategy methods on the HttpProducer so end users can override this class and create their own implementation.
> See nabble:
> http://www.nabble.com/HttpProducer%3A-how-to-access-the-body-of-an-error-page-i-td20475651s22882.html

--
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-1083) camel-http - should store content of response for http errors

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

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

Claus Ibsen resolved CAMEL-1083.
--------------------------------

    Resolution: Fixed

merged to 1.5.1:

D:\project\camel-1x>svn ci -F svnmerge-commit-message.txt
Sending        .
Adding         components\camel-http\src\main\java\org\apache\camel\component\http\DefaultHttpBinding.java
Replacing      components\camel-http\src\main\java\org\apache\camel\component\http\HttpBinding.java
Sending        components\camel-http\src\main\java\org\apache\camel\component\http\HttpComponent.java
Sending        components\camel-http\src\main\java\org\apache\camel\component\http\HttpEndpoint.java
Sending        components\camel-http\src\main\java\org\apache\camel\component\http\HttpMessage.java
Sending        components\camel-http\src\main\java\org\apache\camel\component\http\HttpOperationFailedException.java
Sending        components\camel-http\src\main\java\org\apache\camel\component\http\HttpProducer.java
Sending        components\camel-jetty\src\main\java\org\apache\camel\component\jetty\JettyHttpComponent.java
Adding         components\camel-jetty\src\test\data
Adding  (bin)  components\camel-jetty\src\test\data\logo.jpeg
Adding         components\camel-jetty\src\test\java\org\apache\camel\component\jetty\JettyContentTypeTest.java
Adding         components\camel-jetty\src\test\java\org\apache\camel\component\jetty\JettyHttpBindingRefTest.java
Adding         components\camel-jetty\src\test\java\org\apache\camel\component\jetty\JettyHttpClientOptionsTest.java
Adding         components\camel-jetty\src\test\java\org\apache\camel\component\jetty\JettyImageFileTest.java
Adding         components\camel-jetty\src\test\java\org\apache\camel\component\jetty\JettyResponseBodyWhenErrorTest.java
Transmitting file data ......
Committed revision 719673.

> camel-http - should store content of response for http errors
> -------------------------------------------------------------
>
>                 Key: CAMEL-1083
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1083
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-http
>    Affects Versions: 1.5.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 1.5.1, 2.0.0
>
>         Attachments: camel_1083.patch
>
>
> Currently we do not store the content if there was a eg HTTP error 500 returned. But throw a HttpOperationFailedException.
> We should store the content also so end-users have access to this one as well. Maybe add some strategy methods on the HttpProducer so end users can override this class and create their own implementation.
> See nabble:
> http://www.nabble.com/HttpProducer%3A-how-to-access-the-body-of-an-error-page-i-td20475651s22882.html

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