vendredi 7 décembre 2018

Spring Batch Integration: Increase throughput when consuming data from jms

I work on a task that requires:

  1. consuming data from JMS;
  2. processing it;
  3. loading it into a database.

As the documentation suggests:

  1. I start with <int-jms:message-driven-channel-adapter ... /> to send new JMS messages to the CHANNEL1 channel;
  2. I apply the transformer that converts messages from the CHANNEL1 channel to JobLaunchRequest with a job that inserts data to the database and the payload that contains original JMS message's payload;
  3. The transformed messages go to the CHANNEL2 channel;
  4. <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