camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amitmahesh <laddhaa...@yahoo.com>
Subject transaction handling while moving data from queue to seda to queue
Date Fri, 18 Dec 2015 12:02:12 GMT

We are developing system which processes transactions coming from ATM
machines of various banks.
We take incoming messages to Request Queue, Process it at multiple stages
and Send response back to Response Queue which is then sent back to Socket
connection established when ATM initiated transaction.
I have some questions related to design of this system using ActiveMQ and
Camel.

Q1) Do I need a JTA transaction or regular JMS transaction when I move data
from one queue to another queue of same broker. Assume no Database is
involved and queues are in persistent mode. Since both Queue are associated
with same broker  so both comes under same Resource Manager, so want to
clarify if XA type transaction is involved over here ? 

Q2) Assume I have 3 stages between Request and Response Queue, each stage
might do some data processing like calling a remote service or calling some
local api etc. So do I need to keep a SEDA block for each stage or a regular
pipeline block will suffice. If I consume aysnchronously from Request queue
with some concurrent consumers then I would have already got that many
threads to work on those stages so whats the necessity of introducing SEDA
stages ?? Also SEDA stages might also complicate jms transaction rollback if
any of the stage throws exception. What I want is the data to move from
REquest to Response only when all 3 intermediate stages completes otherwise
message to be redelivered before sending it to DLQ. Only benefit which I see
in using SEDA is that I can declare async concurrent consumers at every
stages, but as I mentioned earlier I already have concurrent consumer
threads consuming from Request Queue and calling these intermediate Services
in pipeline block.

Q3) Assuming I need to save intermediate data in database at every stages of
processing, we dont want to disturb the main loop of request and response
queue bcoz performance is the key in this system, so we thought of sending
intermediate data in a separate queue dedicated for just Inserts/Updates. So
for every transaction I will send a insert message when it reaches the
Request queue and then multiple update messages on completion of each
stages. Failure at Database queue should not stop the main loop. So assuming
incoming transaction message was pipe delimited text, then I convert it to
JPA entity object and send it to DB queue for insert, then after every stage
I update this entity object and send it to DB queue which in turn calls
EntityManager.merge() to update previously inserted record. Will this work
Or we should create entities only after consuming text from DB queue. 










--
View this message in context: http://camel.465427.n5.nabble.com/transaction-handling-while-moving-data-from-queue-to-seda-to-queue-tp5775247.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message