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.