You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by davsclaus <ci...@yahoo.dk> on 2011/01/13 10:32:09 UTC

Re: Camel (2.5) Multicast Component - Body References, Concurrency & Copying

You mail is not going to the camel mailinglist
http://camel.apache.org/discussion-forums.html

Consider subscribing here instead of using nabble
http://camel.apache.org/mailing-lists.html

ad 1)
Yes its sequential by default. There is an option to run parallel.

ad 2)
Yes it copy a reference if its a complex object. There is no generic deep
copy feature in JDK. If you really need this you have to implement deep
copying yourself.

We could maybe introduce some api callback to let you easily hook it into
the multicast. So the callback allows you to perform the copy as you like.
-- 
View this message in context: http://camel.465427.n5.nabble.com/Camel-2-5-Multicast-Component-Body-References-Concurrency-Copying-tp3339259p3339471.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel (2.5) Multicast Component - Body References, Concurrency & Copying

Posted by Claus Ibsen <cl...@gmail.com>.
On Sun, Apr 10, 2011 at 2:46 AM, vcheruvu <v_...@hotmail.com> wrote:
> Is this feature only supported for Java DSL?If not do you have an example on
> how to use onPrepare in Spring DSL?
>

As always Camel you can use any kind of DSL with Camel. So yes of
course you can use it in the XML DSL as well. There is an onPrepareRef
attribute you use on the <multicast> etc.

A good idea is to check the XSD which is something you can always do
in XML. eg its like pressing ctrl + space in the Java editor to see
which methods you can invoke.



>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-2-5-Multicast-Component-Body-References-Concurrency-Copying-tp3339259p4293712.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
CamelOne 2011: http://fusesource.com/camelone2011/
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Camel (2.5) Multicast Component - Body References, Concurrency & Copying

Posted by vcheruvu <v_...@hotmail.com>.
Is this feature only supported for Java DSL?If not do you have an example on
how to use onPrepare in Spring DSL? 


--
View this message in context: http://camel.465427.n5.nabble.com/Camel-2-5-Multicast-Component-Body-References-Concurrency-Copying-tp3339259p4293712.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel (2.5) Multicast Component - Body References, Concurrency & Copying

Posted by davsclaus <ci...@yahoo.dk>.
I have just implemented this feature. It will be in the Camel 2.8 release.

See multicast EIP for examples (wiki page will be synced in a couple of
hours)

-----
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-2-5-Multicast-Component-Body-References-Concurrency-Copying-tp3339259p4292948.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel (2.5) Multicast Component - Body References, Concurrency & Copying

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Jan 18, 2011 at 1:11 AM, nightwolfy
<na...@macquarie.com> wrote:
>
> Hey,
>
> Thanks for the helpful responses.
>
> Just implemented 1 as recommended by Willem, all works, tested and it is now
> multi-threaded!
>
> Using Java DSL here is my example for anyone who looking at this thread in
> the future.
>
>                        from("vm:genericMsg?size=50000&timeout=1000000&concurrentConsumers=50")
>                        .routeId("Transformation-Gen")
>                        .multicast().parallelProcessing()
>                        .to("bean:genericMessageBuilder?method=buildMsg",
>                                "bean:genericMessageBuilder?method=buildEvent")
>                        .end();
>
> For point 2 - as vcheruvu mentioned - I'd be interested to know if a
> callback would be available in the next version of camel.
>

I have created a ticket
https://issues.apache.org/jira/browse/CAMEL-3556

Comment on the ticket for ideas and how you would like the API for the
callback to be.


> Thanks again.
>
> Cheers,
> Nathan
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-2-5-Multicast-Component-Body-References-Concurrency-Copying-tp3339259p3345414.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Camel (2.5) Multicast Component - Body References, Concurrency & Copying

Posted by nightwolfy <na...@macquarie.com>.
Hey,

Thanks for the helpful responses.

Just implemented 1 as recommended by Willem, all works, tested and it is now
multi-threaded!

Using Java DSL here is my example for anyone who looking at this thread in
the future. 

			from("vm:genericMsg?size=50000&timeout=1000000&concurrentConsumers=50")
			.routeId("Transformation-Gen")
			.multicast().parallelProcessing()
			.to("bean:genericMessageBuilder?method=buildMsg",
				"bean:genericMessageBuilder?method=buildEvent")
			.end();

For point 2 - as vcheruvu mentioned - I'd be interested to know if a
callback would be available in the next version of camel. 

Thanks again.

Cheers,
Nathan
-- 
View this message in context: http://camel.465427.n5.nabble.com/Camel-2-5-Multicast-Component-Body-References-Concurrency-Copying-tp3339259p3345414.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel (2.5) Multicast Component - Body References, Concurrency & Copying

Posted by Willem Jiang <wi...@gmail.com>.
On 1/14/11 8:07 AM, vcheruvu wrote:
>
> For 1, I checked in the Camel book to see how i can define parrelelProcessing
> for multicast in Spring DSL.  I do not see an example to specify
> parallelProcessing in Spring DSL. Is it only available in Java DSL?

No, you can set it like this.

  <camelContext xmlns="http://camel.apache.org/schema/spring">
     <route>
       <from uri="direct:a"/>
       <multicast parallelProcessing="true">
           <to uri="direct:x"/>
           <to uri="direct:y"/>
           <to uri="direct:z"/>
       </multicast>
     </route>
     <route>
       <from uri="direct:x"/>
       <process ref="attachStringProcessor"/>
       <to uri="mock:x"/>
     </route>
     <route>
       <from uri="direct:y"/>
       <process ref="attachStringProcessor"/>
       <to uri="mock:y"/>
     </route>
     <route>
       <from uri="direct:z"/>
       <process ref="attachStringProcessor"/>
       <to uri="mock:z"/>
     </route>
   </camelContext>

-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang

Re: Camel (2.5) Multicast Component - Body References, Concurrency & Copying

Posted by vcheruvu <v_...@hotmail.com>.
For 1, I checked in the Camel book to see how i can define parrelelProcessing
for multicast in Spring DSL.  I do not see an example to specify
parallelProcessing in Spring DSL. Is it only available in Java DSL?
-- 
View this message in context: http://camel.465427.n5.nabble.com/Camel-2-5-Multicast-Component-Body-References-Concurrency-Copying-tp3339259p3340664.html
Sent from the Camel - Users mailing list archive at Nabble.com.