2008/7/11 Ingo Meyer <[EMAIL PROTECTED]>: > > Hi, > > I want to use parallel processing of incoming messages per an attribute of > my bean and sending that messages with the camel proxy. I have no idea how > to achieve this. > > Client > ==== > My client is sending a java bean "Job" through an interface "DataService". > This is injected in my client by spring: > > <camel:proxy > id="dataService" > serviceInterface="de.xxx.dataservice.DataService" > serviceUrl="activemq:queue:dataServiceDestination"/> > > The method used from the interface is of type void, so I want to use async > processing. > > Server > ===== > The server is receiving this by the camel xml definition: > > <endpoint id="dataServiceQueue" > uri="activemq:queue:dataServiceDestination"/> > > <route> > <from ref="dataServiceQueue"/> > <to uri="dataService"/> > </route> > > > This works fine so far! Now I want to have 10 threads for processing > messages concurrently with my dataService.
Just set the concurrentConsumers=10 property on the activemq endpoint URI... http://activemq.apache.org/camel/jms.html e.g. <endpoint id="dataServiceQueue" uri="activemq:queue:dataServiceDestination?concurrentConsumers=10"/> > But I need ordered processing as > explained already. > > How can I do that? > I guess the client has to send with the JMSXGroupID and the server has to > create several threads for listening... > > I want to use spring based configuring of camel. What is the corresponding > xml version of: > from("activemq:a").setHeader("JMSXGroupID", > xpath("/invoice/productCode")).to("activemq:b"); <route> <from uri="activemq:a"/> <setHeader name="JMSXGroupID"> <xpath>/invoice/productCode</xpath> </setHeader> <to uri="activemq:b"/> </route> Though you'll need the soon-to-be-released 1.4 to get the <setHeader> element (or use trunk or the 1.4-SNAPSHOT until then) -- James ------- http://macstrac.blogspot.com/ Open Source Integration http://open.iona.com
