You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Bill Skrypnyk (JIRA)" <ji...@apache.org> on 2008/08/11 00:23:52 UTC
[jira] Created: (CAMEL-807) HttpProducer premature out message
creation
HttpProducer premature out message creation
-------------------------------------------
Key: CAMEL-807
URL: https://issues.apache.org/activemq/browse/CAMEL-807
Project: Apache Camel
Issue Type: Bug
Components: camel-http
Affects Versions: 1.4.0
Reporter: Bill Skrypnyk
I believe there is incorrect flow in the HttpProducer which can subvert error handling in the route:
in Camel 1.4.0 in HttpProducer on line 76 a "blank" out message is set on the exchange:
Message out = exchange.getOut(true);
try {
int responseCode = httpClient.executeMethod(method);
...
1. If an IO error occurs on connect, the out message will be passed to the error handling code and if the originating endpoint was a JmsMessage it will cause an NPE when JmsMessage.getMessageId() is called. It also obscures the offending message I believe.
2. A similar situation will happen if the HTTP service returned an error code; the out message will contain a reply message even though the processing resulted in an error (e.g. HTTP Status 500)
3. Also, shouldn't this code test whether the exchange expects an "out" altogether, and if not, perhaps, put just put the return HTTP status into the "in" message header.
--Bill
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Reopened: (CAMEL-807) HttpProducer premature out message
creation
Posted by "Hadrian Zbarcea (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-807?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hadrian Zbarcea reopened CAMEL-807:
-----------------------------------
@Willem, I think for things like 500 (transient errors) it should still be exception.
> HttpProducer premature out message creation
> -------------------------------------------
>
> Key: CAMEL-807
> URL: https://issues.apache.org/activemq/browse/CAMEL-807
> Project: Apache Camel
> Issue Type: Bug
> Components: camel-http
> Affects Versions: 1.4.0
> Reporter: Bill Skrypnyk
> Assignee: Willem Jiang
> Fix For: 1.5.0
>
>
> I believe there is incorrect flow in the HttpProducer which can subvert error handling in the route:
> in Camel 1.4.0 in HttpProducer on line 76 a "blank" out message is set on the exchange:
> Message out = exchange.getOut(true);
> try {
> int responseCode = httpClient.executeMethod(method);
> ...
> 1. If an IO error occurs on connect, the out message will be passed to the error handling code and if the originating endpoint was a JmsMessage it will cause an NPE when JmsMessage.getMessageId() is called. It also obscures the offending message I believe.
> 2. A similar situation will happen if the HTTP service returned an error code; the out message will contain a reply message even though the processing resulted in an error (e.g. HTTP Status 500)
> 3. Also, shouldn't this code test whether the exchange expects an "out" altogether, and if not, perhaps, put just put the return HTTP status into the "in" message header.
> --Bill
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (CAMEL-807) HttpProducer premature out message
creation
Posted by "Hadrian Zbarcea (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-807?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hadrian Zbarcea resolved CAMEL-807.
-----------------------------------
Resolution: Fixed
On a second thought, let's close this one. We'll have quite some cleanup to do across all components after CAMEL-316 is fixed.
> HttpProducer premature out message creation
> -------------------------------------------
>
> Key: CAMEL-807
> URL: https://issues.apache.org/activemq/browse/CAMEL-807
> Project: Apache Camel
> Issue Type: Bug
> Components: camel-http
> Affects Versions: 1.4.0
> Reporter: Bill Skrypnyk
> Assignee: Willem Jiang
> Fix For: 1.5.0
>
>
> I believe there is incorrect flow in the HttpProducer which can subvert error handling in the route:
> in Camel 1.4.0 in HttpProducer on line 76 a "blank" out message is set on the exchange:
> Message out = exchange.getOut(true);
> try {
> int responseCode = httpClient.executeMethod(method);
> ...
> 1. If an IO error occurs on connect, the out message will be passed to the error handling code and if the originating endpoint was a JmsMessage it will cause an NPE when JmsMessage.getMessageId() is called. It also obscures the offending message I believe.
> 2. A similar situation will happen if the HTTP service returned an error code; the out message will contain a reply message even though the processing resulted in an error (e.g. HTTP Status 500)
> 3. Also, shouldn't this code test whether the exchange expects an "out" altogether, and if not, perhaps, put just put the return HTTP status into the "in" message header.
> --Bill
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (CAMEL-807) HttpProducer premature out message
creation
Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-807?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Willem Jiang resolved CAMEL-807.
--------------------------------
Resolution: Fixed
> HttpProducer premature out message creation
> -------------------------------------------
>
> Key: CAMEL-807
> URL: https://issues.apache.org/activemq/browse/CAMEL-807
> Project: Apache Camel
> Issue Type: Bug
> Components: camel-http
> Affects Versions: 1.4.0
> Reporter: Bill Skrypnyk
> Assignee: Willem Jiang
> Fix For: 1.5.0
>
>
> I believe there is incorrect flow in the HttpProducer which can subvert error handling in the route:
> in Camel 1.4.0 in HttpProducer on line 76 a "blank" out message is set on the exchange:
> Message out = exchange.getOut(true);
> try {
> int responseCode = httpClient.executeMethod(method);
> ...
> 1. If an IO error occurs on connect, the out message will be passed to the error handling code and if the originating endpoint was a JmsMessage it will cause an NPE when JmsMessage.getMessageId() is called. It also obscures the offending message I believe.
> 2. A similar situation will happen if the HTTP service returned an error code; the out message will contain a reply message even though the processing resulted in an error (e.g. HTTP Status 500)
> 3. Also, shouldn't this code test whether the exchange expects an "out" altogether, and if not, perhaps, put just put the return HTTP status into the "in" message header.
> --Bill
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAMEL-807) HttpProducer premature out message
creation
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-807?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44920#action_44920 ]
Claus Ibsen commented on CAMEL-807:
-----------------------------------
Thanks for reporting this. Will target this for Camel 1.5.
Ad 1)
Can you provide a unit test the demonstrates this bug? Or at least a routebuilder with the setup? Helps a lot with something to start with.
Ad 2)
Yeah it should test for != 200 and set a fault message or the like for all the non OK result.
Ad 3)
The MEP (InOnly, InOut) is a bit confusing in Camel right now. The components doesn't isn't strict about them. They were added becasue of JBI to my knowledge.
We are discussing to do something about it in Camel 2.0. For now we wont change the current behavior.
But yes doing a isOutCapable is a good idea. and set on in if not.
BTW: If you fancy then patches is highly appreciated
http://activemq.apache.org/camel/contributing.html
> HttpProducer premature out message creation
> -------------------------------------------
>
> Key: CAMEL-807
> URL: https://issues.apache.org/activemq/browse/CAMEL-807
> Project: Apache Camel
> Issue Type: Bug
> Components: camel-http
> Affects Versions: 1.4.0
> Reporter: Bill Skrypnyk
>
> I believe there is incorrect flow in the HttpProducer which can subvert error handling in the route:
> in Camel 1.4.0 in HttpProducer on line 76 a "blank" out message is set on the exchange:
> Message out = exchange.getOut(true);
> try {
> int responseCode = httpClient.executeMethod(method);
> ...
> 1. If an IO error occurs on connect, the out message will be passed to the error handling code and if the originating endpoint was a JmsMessage it will cause an NPE when JmsMessage.getMessageId() is called. It also obscures the offending message I believe.
> 2. A similar situation will happen if the HTTP service returned an error code; the out message will contain a reply message even though the processing resulted in an error (e.g. HTTP Status 500)
> 3. Also, shouldn't this code test whether the exchange expects an "out" altogether, and if not, perhaps, put just put the return HTTP status into the "in" message header.
> --Bill
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (CAMEL-807) HttpProducer premature out message
creation
Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-807?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Willem Jiang reassigned CAMEL-807:
----------------------------------
Assignee: Willem Jiang
> HttpProducer premature out message creation
> -------------------------------------------
>
> Key: CAMEL-807
> URL: https://issues.apache.org/activemq/browse/CAMEL-807
> Project: Apache Camel
> Issue Type: Bug
> Components: camel-http
> Affects Versions: 1.4.0
> Reporter: Bill Skrypnyk
> Assignee: Willem Jiang
> Fix For: 1.5.0
>
>
> I believe there is incorrect flow in the HttpProducer which can subvert error handling in the route:
> in Camel 1.4.0 in HttpProducer on line 76 a "blank" out message is set on the exchange:
> Message out = exchange.getOut(true);
> try {
> int responseCode = httpClient.executeMethod(method);
> ...
> 1. If an IO error occurs on connect, the out message will be passed to the error handling code and if the originating endpoint was a JmsMessage it will cause an NPE when JmsMessage.getMessageId() is called. It also obscures the offending message I believe.
> 2. A similar situation will happen if the HTTP service returned an error code; the out message will contain a reply message even though the processing resulted in an error (e.g. HTTP Status 500)
> 3. Also, shouldn't this code test whether the exchange expects an "out" altogether, and if not, perhaps, put just put the return HTTP status into the "in" message header.
> --Bill
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (CAMEL-807) HttpProducer premature out message
creation
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-807?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen updated CAMEL-807:
------------------------------
Fix Version/s: 1.5.0
> HttpProducer premature out message creation
> -------------------------------------------
>
> Key: CAMEL-807
> URL: https://issues.apache.org/activemq/browse/CAMEL-807
> Project: Apache Camel
> Issue Type: Bug
> Components: camel-http
> Affects Versions: 1.4.0
> Reporter: Bill Skrypnyk
> Fix For: 1.5.0
>
>
> I believe there is incorrect flow in the HttpProducer which can subvert error handling in the route:
> in Camel 1.4.0 in HttpProducer on line 76 a "blank" out message is set on the exchange:
> Message out = exchange.getOut(true);
> try {
> int responseCode = httpClient.executeMethod(method);
> ...
> 1. If an IO error occurs on connect, the out message will be passed to the error handling code and if the originating endpoint was a JmsMessage it will cause an NPE when JmsMessage.getMessageId() is called. It also obscures the offending message I believe.
> 2. A similar situation will happen if the HTTP service returned an error code; the out message will contain a reply message even though the processing resulted in an error (e.g. HTTP Status 500)
> 3. Also, shouldn't this code test whether the exchange expects an "out" altogether, and if not, perhaps, put just put the return HTTP status into the "in" message header.
> --Bill
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CAMEL-807) HttpProducer premature out message
creation
Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-807?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45992#action_45992 ]
Willem Jiang commented on CAMEL-807:
------------------------------------
For
1) I fixed the NPE in CAMEL-785. Please check out the Camel 1.5 snapshot for verification.
2) I just updated the code if the responseCode != 200, we put the result into the fault message.
3) Since we are thinking the InMessage should be a mutable, I'd like to keep the out message for store the result.
Maybe we will review this in the Camel2.0.
> HttpProducer premature out message creation
> -------------------------------------------
>
> Key: CAMEL-807
> URL: https://issues.apache.org/activemq/browse/CAMEL-807
> Project: Apache Camel
> Issue Type: Bug
> Components: camel-http
> Affects Versions: 1.4.0
> Reporter: Bill Skrypnyk
> Assignee: Willem Jiang
> Fix For: 1.5.0
>
>
> I believe there is incorrect flow in the HttpProducer which can subvert error handling in the route:
> in Camel 1.4.0 in HttpProducer on line 76 a "blank" out message is set on the exchange:
> Message out = exchange.getOut(true);
> try {
> int responseCode = httpClient.executeMethod(method);
> ...
> 1. If an IO error occurs on connect, the out message will be passed to the error handling code and if the originating endpoint was a JmsMessage it will cause an NPE when JmsMessage.getMessageId() is called. It also obscures the offending message I believe.
> 2. A similar situation will happen if the HTTP service returned an error code; the out message will contain a reply message even though the processing resulted in an error (e.g. HTTP Status 500)
> 3. Also, shouldn't this code test whether the exchange expects an "out" altogether, and if not, perhaps, put just put the return HTTP status into the "in" message header.
> --Bill
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.