camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tourist604 <>
Subject HttpProducer incorrect behaviour
Date Fri, 08 Aug 2008 18:44:07 GMT


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.

Perhaps, I am missing also how to get a hold of the original Exchange and
Message if the route execution resulted in a "logical" error. The original
Message can then be squirrelled away for later retries for example.

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message