You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Camel Guy <ca...@devguy.com> on 2014/05/19 21:34:01 UTC

Puzzler: Best NoOp route

Hello,

I'm building a framework in Spring DSL and I need a route that does nothing
(e.g., testing mode). Since a route has to do something (otherwise Spring
DSL fails), ?? below must be replaced by something.

<route>
 <from uri="direct:NoOp"/>

??

</route>

I was using <transform><simple/></transform> but I recently discovered that
<choice/> works.

What could be put in ?? that has even less overhead?


Thank you!

Re: Puzzler: Best NoOp route

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, May 20, 2014 at 8:45 AM, Camel Guy <ca...@devguy.com> wrote:
> Hm. Does that stop the invoking route too?
>

No just stops continue routing the message.


> On Monday, May 19, 2014, Claus Ibsen <cl...@gmail.com> wrote:
>
>> Hi
>>
>> Maybe use </stop> is the shortest
>>
>> <route>
>>   <from ...>
>>   </stop>
>> </route>
>>
>>
>>
>> On Mon, May 19, 2014 at 9:34 PM, Camel Guy <camel@devguy.com<javascript:;>>
>> wrote:
>> > Hello,
>> >
>> > I'm building a framework in Spring DSL and I need a route that does
>> nothing
>> > (e.g., testing mode). Since a route has to do something (otherwise Spring
>> > DSL fails), ?? below must be replaced by something.
>> >
>> > <route>
>> >  <from uri="direct:NoOp"/>
>> >
>> > ??
>> >
>> > </route>
>> >
>> > I was using <transform><simple/></transform> but I recently discovered
>> that
>> > <choice/> works.
>> >
>> > What could be put in ?? that has even less overhead?
>> >
>> >
>> > Thank you!
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> Red Hat, Inc.
>> Email: cibsen@redhat.com <javascript:;>
>> Twitter: davsclaus
>> Blog: http://davsclaus.com
>> Author of Camel in Action: http://www.manning.com/ibsen
>> hawtio: http://hawt.io/
>> fabric8: http://fabric8.io/
>>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Re: Puzzler: Best NoOp route

Posted by Camel Guy <ca...@devguy.com>.
Hm. Does that stop the invoking route too?

On Monday, May 19, 2014, Claus Ibsen <cl...@gmail.com> wrote:

> Hi
>
> Maybe use </stop> is the shortest
>
> <route>
>   <from ...>
>   </stop>
> </route>
>
>
>
> On Mon, May 19, 2014 at 9:34 PM, Camel Guy <camel@devguy.com<javascript:;>>
> wrote:
> > Hello,
> >
> > I'm building a framework in Spring DSL and I need a route that does
> nothing
> > (e.g., testing mode). Since a route has to do something (otherwise Spring
> > DSL fails), ?? below must be replaced by something.
> >
> > <route>
> >  <from uri="direct:NoOp"/>
> >
> > ??
> >
> > </route>
> >
> > I was using <transform><simple/></transform> but I recently discovered
> that
> > <choice/> works.
> >
> > What could be put in ?? that has even less overhead?
> >
> >
> > Thank you!
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: cibsen@redhat.com <javascript:;>
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> hawtio: http://hawt.io/
> fabric8: http://fabric8.io/
>

Re: Puzzler: Best NoOp route

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

Maybe use </stop> is the shortest

<route>
  <from ...>
  </stop>
</route>



On Mon, May 19, 2014 at 9:34 PM, Camel Guy <ca...@devguy.com> wrote:
> Hello,
>
> I'm building a framework in Spring DSL and I need a route that does nothing
> (e.g., testing mode). Since a route has to do something (otherwise Spring
> DSL fails), ?? below must be replaced by something.
>
> <route>
>  <from uri="direct:NoOp"/>
>
> ??
>
> </route>
>
> I was using <transform><simple/></transform> but I recently discovered that
> <choice/> works.
>
> What could be put in ?? that has even less overhead?
>
>
> Thank you!



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Re: Puzzler: Best NoOp route

Posted by Antoine DESSAIGNE <an...@gmail.com>.
By the way, you may not even have to define any <route> tags in your
<camelContext>

Antoine.
Le 19 mai 2014 22:08, "Antoine DESSAIGNE" <an...@gmail.com> a
écrit :

> Hello.
>
> You can do the following thing :
>
> <route>
>     <from uri="direct:input" />
>     <to uri="direct:output" />
> </route>
>
> But I prefer being able to tell whether or not the route is properly
> starting but using the following route :
>
> <route>
>     <from uri="timer:single?repeatCount=1" />
>     <log message="I'm logging this" />
> </route>
>
> Hope this helps,
>
> Antoine.
> Le 19 mai 2014 21:35, "Camel Guy" <ca...@devguy.com> a écrit :
>
>> Hello,
>>
>> I'm building a framework in Spring DSL and I need a route that does
>> nothing
>> (e.g., testing mode). Since a route has to do something (otherwise Spring
>> DSL fails), ?? below must be replaced by something.
>>
>> <route>
>>  <from uri="direct:NoOp"/>
>>
>> ??
>>
>> </route>
>>
>> I was using <transform><simple/></transform> but I recently discovered
>> that
>> <choice/> works.
>>
>> What could be put in ?? that has even less overhead?
>>
>>
>> Thank you!
>>
>

Re: Puzzler: Best NoOp route

Posted by Antoine DESSAIGNE <an...@gmail.com>.
Hello.

You can do the following thing :

<route>
    <from uri="direct:input" />
    <to uri="direct:output" />
</route>

But I prefer being able to tell whether or not the route is properly
starting but using the following route :

<route>
    <from uri="timer:single?repeatCount=1" />
    <log message="I'm logging this" />
</route>

Hope this helps,

Antoine.
Le 19 mai 2014 21:35, "Camel Guy" <ca...@devguy.com> a écrit :

> Hello,
>
> I'm building a framework in Spring DSL and I need a route that does nothing
> (e.g., testing mode). Since a route has to do something (otherwise Spring
> DSL fails), ?? below must be replaced by something.
>
> <route>
>  <from uri="direct:NoOp"/>
>
> ??
>
> </route>
>
> I was using <transform><simple/></transform> but I recently discovered that
> <choice/> works.
>
> What could be put in ?? that has even less overhead?
>
>
> Thank you!
>