[ 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.