You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by nishat <ni...@gmail.com> on 2016/12/09 14:35:47 UTC

Camel Multicast behaving strangely - please help

Hello All 

i am getting as strange behavior from camel multicast. Looks like i am doing
something wrong but cant point it. Need your help urgently. 

I a creating a multicast route to two endpoints as below:
Start point : direct://start
endpoint : direct://route1
endpoint : direct://route2

Routes info : 

1) from("direct://start").process(new DeepCloneRequest()).multicast(new
Aggregator()).to("direct://route1","direct://route2")

2) from("direct://route1").setheader(<to use later in
processor>).process(<do some preprocessing>).to("rest url1").processor(<to
do post processing>).end

3) from("direct://route2").setheader(<to use later in
processor>).process(<do some preprocessing>).to("rest url2").processor(<to
do post processing>).end

what i notice is that in my route number 3 in preprocessing i got the
exchange out of number 2 preprocessing instead of DeepCloneRequest from
nulticast. 

Can someone please help explain this? I want to get same request that
multicast receive in both route 2 and 3.




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Multicast-behaving-strangely-please-help-tp5791319.html
Sent from the Camel - Users mailing list archive at Nabble.com.

RE: Camel Multicast behaving strangely - please help

Posted by nishat <ni...@gmail.com>.
Thanks for the response. but the problem is that my endpoint are coming from
a ArraylistList for multicast. But i will try you suggestion by hard coding
it. will let you know in a while.



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Multicast-behaving-strangely-please-help-tp5791319p5791322.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel Multicast behaving strangely - please help

Posted by Nikhil Vibhav <ni...@gmail.com>.
Hey Nishat,

I see that you've added the 'new DeepCloneRequest()' in a process()
statement rather than a 'onPrepare()'.

Can you check the onPrepare section (the last section) for the Camel
multicast documentation - http://camel.apache.org/multicast.html

Thanks, Nikhil.

On Tue, 13 Dec 2016 at 02:16 nishat <ni...@gmail.com> wrote:

> Hello Nikhil,
>
> just to clarify the request is a pojo. and i want to send the exact copy of
> request to the multicasted endpoints. The problem is after first route in
> multicast, the second route dont get the exact copy of the initial route
> but
> a processed copy of first route. hoping to receive some more help form you.
>
> also noticed that multicast send the same request object to both routes
> instead of copy of initial request.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-Multicast-behaving-strangely-please-help-tp5791319p5791378.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Camel Multicast behaving strangely - please help

Posted by nishat <ni...@gmail.com>.
Hello Nikhil, 

just to clarify the request is a pojo. and i want to send the exact copy of
request to the multicasted endpoints. The problem is after first route in
multicast, the second route dont get the exact copy of the initial route but
a processed copy of first route. hoping to receive some more help form you.

also noticed that multicast send the same request object to both routes
instead of copy of initial request.



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Multicast-behaving-strangely-please-help-tp5791319p5791378.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel Multicast behaving strangely - please help

Posted by Nikhil Vibhav <ni...@gmail.com>.
Hi Nishat,

If the request at the endpoint is an ArrayList and you need to send
individual elements of that list to different routes, you can also use a
splitter to split the body and then parallel process and send it to
different routes (instead of multicast).

Thanks, Nikhil

On Mon, 12 Dec 2016 at 14:00 nishat <ni...@gmail.com> wrote:

> Hello Hans,
>
> I tried your suggestion but got the same issue. any other idea?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-Multicast-behaving-strangely-please-help-tp5791319p5791327.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

RE: Camel Multicast behaving strangely - please help

Posted by nishat <ni...@gmail.com>.
Hello Hans, 

I tried your suggestion but got the same issue. any other idea?



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Multicast-behaving-strangely-please-help-tp5791319p5791327.html
Sent from the Camel - Users mailing list archive at Nabble.com.

RE: Camel Multicast behaving strangely - please help

Posted by Hans Orbaan <ha...@docdata.eu>.
Can you try:
multicast(.....)
.to("direct://route1")
.to("direct://route2")

-----Oorspronkelijk bericht-----
Van: nishat [mailto:nishat.dhillon@gmail.com] 
Verzonden: Friday 9 December 2016 15:36
Aan: users@camel.apache.org
Onderwerp: Camel Multicast behaving strangely - please help

Hello All 

i am getting as strange behavior from camel multicast. Looks like i am doing something wrong but cant point it. Need your help urgently. 

I a creating a multicast route to two endpoints as below:
Start point : direct://start
endpoint : direct://route1
endpoint : direct://route2

Routes info : 

1) from("direct://start").process(new DeepCloneRequest()).multicast(new
Aggregator()).to("direct://route1","direct://route2")

2) from("direct://route1").setheader(<to use later in
processor>).process(<do some preprocessing>).to("rest 
processor>url1").processor(<to
do post processing>).end

3) from("direct://route2").setheader(<to use later in
processor>).process(<do some preprocessing>).to("rest 
processor>url2").processor(<to
do post processing>).end

what i notice is that in my route number 3 in preprocessing i got the exchange out of number 2 preprocessing instead of DeepCloneRequest from nulticast. 

Can someone please help explain this? I want to get same request that multicast receive in both route 2 and 3.




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Multicast-behaving-strangely-please-help-tp5791319.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel Multicast behaving strangely - please help

Posted by nishat <ni...@gmail.com>.
the camel version i am using is 2.17.3



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Multicast-behaving-strangely-please-help-tp5791319p5791320.html
Sent from the Camel - Users mailing list archive at Nabble.com.