A message-driven bean is a new type of Enterprise Java Bean as described in the EJB 2.0 specification.

Basically, the big difference between an MDB and a regular session bean is that MDBs can be targeted by JMS messages. JMS (Java Messaging Service) is a technology that facilitates communication between applications over a network (such as a company LAN, or the internet).

Benefits of Message driven beans include an offline messaging queue, Simple integration with an already huge base of existing J2EE applications, and simple implementation of publish/subscribe architecture.

Although message-driven beans are great, it is generally not considered to be great enough to warrant rewrites of already working and tested software. JMS basically works the same way RMI and IIOP work. it is just a Java implementation that attempts to draw all of the technology into the Java world.

A message-driven bean must implement the javax.ejb.MessageDrivenContext interface and should define four methods:

JMS and message-driven beans are recommended for all new development. Eventually, CORBA will not be needed and it can die along with all other non-java technologies.

Log in or register to write something here or to contact authors.