I guess it's not possible.
You can try to add a sender id to your messages and your
receiver can sort out them by the id... but it's not exactly what you want.
I recommend you use different queues for senders and your
receiver can listen all of them.
Robisz, thanks for your inputs. Shall I use a transacted session to solve the problem? Will JMS ensures that a messages sent from a transacted session to a Queue will always arrive in the Queue in a group
Transacted sessions will ensure that all or none (in case of failure) of your messages will be stored in the queue, but this does NOT mean, that there is a logical grouping between these messages which can be used for group based message processing on the client side !
Read the JMS specification. You should not make any assumtions on message delivery order, as this would prohibit MDB scalebility ! Each message is treated as a independant logical unit of work.