I am using MessageListener, please help!
JMS message processing is message oriented, not batch oriented. Also do not expect a fixed message order, as this is not specified by the JMS specification. If you want to handle message batches than you have to implement the logic by yourself.
I have a similar situation and I resolved it as follows:
- the MDB is able to process single messages (encapsulated in ObjectMessage)
- the MDB is able to process linked list of messages
Note. To preserve the ordering you have to adjust your MDB to be singelton (tradeoff with performance, it's you call in this case)