Difference between MDB and JMS

JavaUser picture JavaUser · Jan 15, 2011 · Viewed 11.3k times · Source

Please let me know what is the difference between:

Answer

skaffman picture skaffman · Jan 15, 2011

JMS and Message-driven beans are not either/or choice, the two are complimentary.

JMS is the API and technology for passing messages around. Message-driven beans (MDB) are an API for receiving JMS messages as events in the EJB style. There are many ways of handling JMS messages, MDB is just one of them.

From the JavaEE tutorial:

Message-driven beans can implement any messaging type. Most commonly, they implement the Java Message Service (JMS) technology.

Your subject, by the way, talks abut MBeans - this is entirely different (that refers to the JMX API), and nothing to do with JMS.