OSDir


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

RE: How to use InterceptSendToEndpoint from Java DSL


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