camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karthz <>
Subject InterceptSendToEndpoint - Http Component
Date Tue, 07 Dec 2010 22:19:47 GMT


I'm using Camel 2.5. And, this is an outline of what I'm trying to do,

        <camel:interceptSendToEndpoint uri="{{custom.url}}"
                <camel:to uri="bean:xyz?method=throwException" />
                    <camel:log message="Message Failure" />
                    <camel:stop />

        <camel:route id="route1">
            <camel:from uri="direct:something" />
            <camel:to uri="bean:xyz?method=doNothing" />
            <camel:to uri="{{custom.url}}" />
            <camel:log message="Message Success" />

Looks like there's an issue while intercepting messages sent to a Http
Component. It gets intercepted correctly, and "Message Failure" gets printed
in the logs correctly too.  However, the message still gets sent to the Http
component anyway. [Note: the  "Message Success", however, doesn't get
printed in the logs.]

This behavior remains even if I use
               <camel:interceptSendToEndpoint uri="http*"
AND/OR the actual http url, instead of the placeholder
               <camel:to uri="http://localhost:8080/test" />

But if I intercept something else, and not the http component, then it works
fine. In the above route, this change
uri="bean:xyz?method=doNothing" inheritErrorHandler="true">
does exactly what I want it to do. It intercepts before the method, and the
method never gets executed in case of an exception.

So, what's the correct way to intercept something that's being sent to a
Http Component?


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

View raw message