You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Rajith Muditha Attapattu <ra...@gmail.com> on 2016/08/22 18:30:42 UTC

DynamicRouter vs RoutingSlip

On the surface both look very similar.
Whats the difference between the two? and when would you choose one
over the other?

Regards,

Rajith Muditha Attapattu

Re: DynamicRouter vs RoutingSlip

Posted by Rajith Muditha Attapattu <ra...@gmail.com>.
Thank you Claus!
I just found out (the hard way) that I need to return null in the
dynamic router :)


On Mon, Aug 22, 2016 at 2:59 PM, Claus Ibsen <cl...@gmail.com> wrote:
> Routing slip is calculated once and is therefore static.
>
> Dynamic route is evaluated after each step and is therefore dynamic.
> It keeps going on until the evaluation returns null / empty value.
>
> On Mon, Aug 22, 2016 at 8:42 PM, Rajith Muditha Attapattu
> <ra...@gmail.com> wrote:
>> The routing slip method relies on a header to get the sequence, where
>> as with the DynamicRouter gives more flexibility by allowing a bean to
>> calculate the next step.
>> Apart from that are there any differences?
>>
>> On Mon, Aug 22, 2016 at 2:30 PM, Rajith Muditha Attapattu
>> <ra...@gmail.com> wrote:
>>> On the surface both look very similar.
>>> Whats the difference between the two? and when would you choose one
>>> over the other?
>>>
>>> Regards,
>>>
>>> Rajith Muditha Attapattu
>>
>>
>>
>> --
>> Regards,
>>
>> Rajith Muditha Attapattu
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2



-- 
Regards,

Rajith Muditha Attapattu

Re: DynamicRouter vs RoutingSlip

Posted by Claus Ibsen <cl...@gmail.com>.
Routing slip is calculated once and is therefore static.

Dynamic route is evaluated after each step and is therefore dynamic.
It keeps going on until the evaluation returns null / empty value.

On Mon, Aug 22, 2016 at 8:42 PM, Rajith Muditha Attapattu
<ra...@gmail.com> wrote:
> The routing slip method relies on a header to get the sequence, where
> as with the DynamicRouter gives more flexibility by allowing a bean to
> calculate the next step.
> Apart from that are there any differences?
>
> On Mon, Aug 22, 2016 at 2:30 PM, Rajith Muditha Attapattu
> <ra...@gmail.com> wrote:
>> On the surface both look very similar.
>> Whats the difference between the two? and when would you choose one
>> over the other?
>>
>> Regards,
>>
>> Rajith Muditha Attapattu
>
>
>
> --
> Regards,
>
> Rajith Muditha Attapattu



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

Re: DynamicRouter vs RoutingSlip

Posted by Rajith Muditha Attapattu <ra...@gmail.com>.
Thank you Brad for the valuable info!

On Mon, Aug 22, 2016 at 3:06 PM, Brad Johnson
<br...@mediadriver.com> wrote:
> By the way, you may also want to compare those to a recipientList which is
> fairly simple to use and can be used with pretty much any sort of variable.
>
>
> http://camel.apache.org/recipient-list.html
>
> For example, I've used it with a combined REST/SOAP interface in CXF to
> route a request based on the operationName.
>
> <recipientList>
> <simple>direct-vm:${header.operationName}</simple>
> </recipientList>
>
> Unfortunately some of the Camel CXF documentation is a bit crufty.  You can
> now use interfaces instead of of concrete classes and the permits
> overloading the annotations on the interface for both SOAP and REST but use
> the same routes for both.
>
> I've also used it to do things like invoke templates for velocity on routes.
>
> .recipientList(header(MAIL_TEMPLATE))
>
> On Mon, Aug 22, 2016 at 1:42 PM, Rajith Muditha Attapattu <
> rajith77@gmail.com> wrote:
>
>> The routing slip method relies on a header to get the sequence, where
>> as with the DynamicRouter gives more flexibility by allowing a bean to
>> calculate the next step.
>> Apart from that are there any differences?
>>
>> On Mon, Aug 22, 2016 at 2:30 PM, Rajith Muditha Attapattu
>> <ra...@gmail.com> wrote:
>> > On the surface both look very similar.
>> > Whats the difference between the two? and when would you choose one
>> > over the other?
>> >
>> > Regards,
>> >
>> > Rajith Muditha Attapattu
>>
>>
>>
>> --
>> Regards,
>>
>> Rajith Muditha Attapattu
>>



-- 
Regards,

Rajith Muditha Attapattu

Re: DynamicRouter vs RoutingSlip

Posted by Brad Johnson <br...@mediadriver.com>.
By the way, you may also want to compare those to a recipientList which is
fairly simple to use and can be used with pretty much any sort of variable.


http://camel.apache.org/recipient-list.html

For example, I've used it with a combined REST/SOAP interface in CXF to
route a request based on the operationName.

<recipientList>
<simple>direct-vm:${header.operationName}</simple>
</recipientList>

Unfortunately some of the Camel CXF documentation is a bit crufty.  You can
now use interfaces instead of of concrete classes and the permits
overloading the annotations on the interface for both SOAP and REST but use
the same routes for both.

I've also used it to do things like invoke templates for velocity on routes.

.recipientList(header(MAIL_TEMPLATE))

On Mon, Aug 22, 2016 at 1:42 PM, Rajith Muditha Attapattu <
rajith77@gmail.com> wrote:

> The routing slip method relies on a header to get the sequence, where
> as with the DynamicRouter gives more flexibility by allowing a bean to
> calculate the next step.
> Apart from that are there any differences?
>
> On Mon, Aug 22, 2016 at 2:30 PM, Rajith Muditha Attapattu
> <ra...@gmail.com> wrote:
> > On the surface both look very similar.
> > Whats the difference between the two? and when would you choose one
> > over the other?
> >
> > Regards,
> >
> > Rajith Muditha Attapattu
>
>
>
> --
> Regards,
>
> Rajith Muditha Attapattu
>

Re: DynamicRouter vs RoutingSlip

Posted by Rajith Muditha Attapattu <ra...@gmail.com>.
The routing slip method relies on a header to get the sequence, where
as with the DynamicRouter gives more flexibility by allowing a bean to
calculate the next step.
Apart from that are there any differences?

On Mon, Aug 22, 2016 at 2:30 PM, Rajith Muditha Attapattu
<ra...@gmail.com> wrote:
> On the surface both look very similar.
> Whats the difference between the two? and when would you choose one
> over the other?
>
> Regards,
>
> Rajith Muditha Attapattu



-- 
Regards,

Rajith Muditha Attapattu