Sending Messages in Batch using JMS

emadhu
emadhu used Ask the Experts™
on
How to send messages in batch using JMS API. We have the current implementation which sends messages one by one, we would like to send the messages in a batch instead to speed up
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
The JMS API does not have a batch method for sending messages.  However, some JMS servers can send messages in batch, but it is at the trasport level and not at the JMS API level.  Which JMS server are you using?

Author

Commented:
using tibco middleware
TIBCO EMS has a Queue feature called PreFetch. Once the messages are put in the queue, the listening client will grab all waiting messages in bulk up to the PreFetch limit.  However, per JMS spec, all message are confirmed individually.

TIBCO EMS also as the ability to put messages inside message using an enhance JMS MapMessage.  However, both the producer and consumer will need to be coded to deal with the MapMessage structure.  Look at the EMS Users Guide for more details on the TIBCO enhanced MapMessage.

I would just do the PreFetch if the performance is good enough, otherwise you will have to use the TIBCO enhanced MapMessage.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial