I am working on a data processing application in which concurrency is achieved by putting several units of work in a message queue that several instances of a message-driven object (MDB) are listening on. Besides achieving concurrency in this way, we have no particular reason to use the messaging infrastructure and MDB.
This made me wonder why this could not be achieved using multiple threads.
So my question is, in what situations can asynchronous messaging (e.g. JMS) be used as an alternative to multithreading as a means of achieving concurrency? What are some of the advantages / disadvantages of using one approach over another.
source
share