[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to use InterceptSendToEndpoint from Java DSL


Here is an example how to do it

On Fri, Jun 8, 2018 at 7:16 PM, Jackson, Douglas
<douglas.s.jackson@xxxxxxxxxxx> wrote:
> Hi!
> Thanks so much for responding.  It is awesome to have someone of your caliber answering my questions!
>> Ah okay yeah you can have it in one route builder, where you can have
>> all your interceptors. Then during startup it will re-register any
>> existing endpoints with itself so it can proxy/detour.
> My initial attempt was to create a RouteBuilder and in the configure method call the interceptSendToEndpoint() method a few times.
>       camelContext.addRoutes(new RouteBuilder() {
>                @Override
>                public void configure()
>                throws Exception {
>                   interceptSendToEndpoint("activemq:queue:.*-xxx").to("direct:queued-Interceptor");
>                   interceptSendToEndpoint("activemq:queue:.*-xxx-dlq").to("direct:queued-Interceptor");
>                   interceptSendToEndpoint("activemq:queue:.*-xxx-paused").to("direct:queued-Interceptor");
>                }
>         });
> However, the queued-interceptor route was never fired when a message was posted to activemq.
> So I assumed that those interceptors were not acting beyond the context of the route.
> -Doug

Claus Ibsen
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2