I work on a task that requires:
- consuming data from JMS;
- processing it;
- loading it into a database.
As the documentation suggests:
- I start with
<int-jms:message-driven-channel-adapter ... />
to send newJMS
messages to theCHANNEL1
channel; - I apply the transformer that converts messages from the
CHANNEL1
channel toJobLaunchRequest
with a job that inserts data to the database and the payload that contains originalJMS
message's payload; - The transformed messages go to the
CHANNEL2
channel; <batch-int:job-launching-gateway request-channel="CHANNEL2"/>
starts a new job execution when a new message appears in the channel;
The problem is that I start a new database transaction each time a new jms messages received.
The question: how should I handle such flow? What is the common pattern for this?
Aucun commentaire:
Enregistrer un commentaire