You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "kraythe ." <kr...@gmail.com> on 2014/04/04 19:06:30 UTC

AMQ Partially Transacted Client?

Greetings,

I have an odd need. Basically I need to have a transactional client that
only is transacted on sending messages but not consuming them.

I have a route that polls a database on a quartz timer and then makes a SQL
call. If the call returns any records, they get split up and put on an
event queue. The event queue messages are basically something like "Process
table X".

Now here is the interesting part. I want to consume the event from the
queue, read the records from table X and turn each record into a message
which goes to the routing queue. From there they will be routed to the
correct processors. However, if there is any exception in putting records
on the routing queue for any of the n records, I want all n records to come
back off the queue but have the event still be dropped. The records will be
pulled in the next poll.

The reason for the desire is that I have no way of annotating a record as
processed individually so I can only ingest either the entire table or
nothing at all. If I don't ingest the table it will get appended so that is
no big deal but if I ingest the table and mark it as processed the records
will be replaced.

I was thinking a split with a shared unit of work might accomplish this but
the problem is that the records 1 - 10 end up on the routing queue even
though record 11 fails. Although the exception sends the event to dead, the
records don't come back off the queue.

Any ideas on how I could solve this another way ?

*Robert Simmons Jr. MSc. - Lead Java Architect @ EA*
*Author of: Hardcore Java (2003) and Maintainable Java (2012)*
*LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39
<http://www.linkedin.com/pub/robert-simmons/40/852/a39>*