You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Jackson, Douglas" <do...@siemens.com> on 2018/06/08 15:40:36 UTC

How to use InterceptSendToEndpoint from Java DSL

Hi!
I need to replace my blueprint DSL with Java DSL. I want to intercept all attempts to send to certain queues, not just for one route, but for everything.
Here is the blueprint DSL:

    <camelContext xmlns="http://camel.apache.org/schema/blueprint">

        <interceptSendToEndpoint uri="activemq:queue:.*-xxx"><to uri="direct:queued-Intercept"/></interceptSendToEndpoint>
        <interceptSendToEndpoint uri="activemq:queue:.*-xxx-dlq"><to uri="direct:queued-Intercept"/></interceptSendToEndpoint>
        <interceptSendToEndpoint uri="activemq:queue:.*-xxx-paused"><to uri="direct:queued-Intercept"/></interceptSendToEndpoint>

When I put calls to the interceptSendToEndpoint() method in a RouteBuilder configure method, they did not work.


The java documentation on the InterceptSendToEndpoint is poor. I have also found no good examples.


Douglas Jackson


Re: How to use InterceptSendToEndpoint from Java DSL

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

You put it in each of your RouteBuilder classes, or in a abstract
super class of yours, and then call super.configure() for each of your
routes.

You can find examples of using it in the camel-core unit tests itself,
just do a git grep.



On Fri, Jun 8, 2018 at 5:40 PM, Jackson, Douglas
<do...@siemens.com> wrote:
> Hi!
> I need to replace my blueprint DSL with Java DSL. I want to intercept all attempts to send to certain queues, not just for one route, but for everything.
> Here is the blueprint DSL:
>
>     <camelContext xmlns="http://camel.apache.org/schema/blueprint">
>
>         <interceptSendToEndpoint uri="activemq:queue:.*-xxx"><to uri="direct:queued-Intercept"/></interceptSendToEndpoint>
>         <interceptSendToEndpoint uri="activemq:queue:.*-xxx-dlq"><to uri="direct:queued-Intercept"/></interceptSendToEndpoint>
>         <interceptSendToEndpoint uri="activemq:queue:.*-xxx-paused"><to uri="direct:queued-Intercept"/></interceptSendToEndpoint>
>
> When I put calls to the interceptSendToEndpoint() method in a RouteBuilder configure method, they did not work.
>
>
> The java documentation on the InterceptSendToEndpoint is poor. I have also found no good examples.
>
>
> Douglas Jackson
>



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