Generally speaking for queues, you could have a pool of MDBs each receiving a subset of the messages coming in but there are two things to be worried about:
- You can't control order of messages in queues. You never can. You may process messages that are newer than some old messageswaiting to be processed (even in the case of a single MDB in the pool this can happen).
- You can't control which MDB in the pool gets messages so you need some kind of persistent storage device like a database coordinating multi-step communications such as negotiating a customer transaction.
And if you follow the
EJB spec, everything is thread safe. The only time you violate thread safe is if you spawn your own threads.
[ September 28, 2008: Message edited by: Scott Selikoff ]