JMS trigger batch processing with minimal sessions

Hi,

We are using JMS trigger for batch processing. Everything is working fine while the trigger continuously monitoring the queue and taking messages in batch(say 100) and pushing this to the subscribing service to handle using pub.jms:batchTriggerSpec.

But we got a requirement like this,

1.The trigger need to wait monitoring the queue - until the messages in the queue reaches the max batch size 100(mentioned in the trigger properties). Is there any possibility to do this.
2. The problem we found by the trigger continuously monitoring the queue in batch processing is, it is creating multiple sessions to receive each of the message, so the sessions(start and end) Example - 100 messages*2 =200 rows in wMsession table.

We want to avoid this case, where the trigger should wait until the batch size reaches in the queue and then pick the messages(batch100). so that it will create a single session (start and end).

Note: This all should happen in real time, disabling trigger option not worthy.

Appreciate your help…

Thanks…

Hello Sudheer

You can create a JMS consumer and schedule it to receive the messages on demand rather than receiving the message when its available in the JMS destination.

Regards
Sasa

1 Like

Hi Sasa,

Thanks for the response, I tried the JMS consumer and scheduled it to run as per the required time interval.

It’s serving purpose for the time being, will do some more testing to finalize this approach.

Thanks,
S7