When I send a message to "direct:test1" in the following route builder, the
"hello" is written three-times to the console instead of only once, as
expected.

interceptSendToEndpoint("direct:intercept")
.process(new Processor() {
    public void process(Exchange exchange) throws Exception {
        System.out.println("hello");
    }
});

from("direct:test1").to("direct:intercept");
from("direct:test2").to("direct:intercept");
from("direct:test3").to("direct:intercept");

The problem is that the "direct:intercept" endpoint is proxied/decorated
several times with an InterceptSendToEndpoint object, depending on the
number of to("direct:intercept") in the route builder.

One possible bugfix for this problem is to decorate the original endpoint
only if it's not already decorated (special handling in
InterceptSendToEndpoint class), but I'm not sure if this is the best
solution. If this sounds reasonable I can provide a patch.

Cheers,
Martin
-- 
View this message in context: 
http://www.nabble.com/Issue-with-interceptSendToEndpoint-tp25859201p25859201.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to