Your DB access bean could return a result that is later split into
multiple messages.  Just use a splitter.  See:
http://activemq.apache.org/camel/splitter.html

Regards,
Hiram

On Jan 3, 2008 12:04 PM, Patrick Shea <[EMAIL PROTECTED]> wrote:
> I'm using a quartz endpoint to call a bean. This bean reads a table and 
> create multiple messages. It's basically a CamelContextAware bean and I'm 
> creating a CamelTemplate to send to an activemq endpoint.
>
> I'm just wondering if there a way to express this using routes instead of me 
> programatically calling template.sendBody(...)
>
> Patrick
>
>
> -----Original Message-----
> From: James Strachan <[EMAIL PROTECTED]>
> Sent: Thursday, January 3, 2008 5:32am
> To: [email protected], [EMAIL PROTECTED]
> Subject: Re: How to create multiple outbound messages
>
> On 03/01/2008, Patrick Shea <[EMAIL PROTECTED]> wrote:
> > Hi, I'm trying to express using routes how to create multiple messages from 
> > one endpoint.
>
> FWIW the JPA endpoint does this...
> http://activemq.apache.org/camel/jpa.html
>
> e.g.
>
> from("jpa:com.acme.MyFoo").to("activemq:MyQueue")
>
> would send a message for each MyFoo entity in the database (deleting
> them after the message has been sent).
>
> If you would rather update the entity bean rather than delete it, you
> can annotate a method with @Consumed and it'll call that to update
> itself - then use the ?consumeDelete=false on the URI.
>
>
> > I did use an internal template to sendBody() multiple time but what I am 
> > trying to do is read a sql table, send a jms message for each row, wait for 
> > acknowledment then update the record.
>
> Are you using any of the existing endpoints or writing your own?
>
> > I tried to use the CLIENT_ACKNOWLEDGE parameter on the endpoint but this 
> > does not seem to work.
>
> Acknowlegements are only really used for consuming JMS messages. Once
> a send in JMS is completed its done.
>
> You could look at using Spring declarative transactions when working
> with JMS; then you can switch from pure JMS transactions to XA if ever
> you need it etc.
> --
> James
> -------
> http://macstrac.blogspot.com/
>
> Open Source Integration
> http://open.iona.com
>
>
>
>



-- 
Regards,
Hiram

Blog: http://hiramchirino.com

Open Source SOA
http://open.iona.com

Reply via email to