2.2 Message Driven Bean (MDB)

A message-driven bean is an enterprise bean that allows Java EE applications to process messages asynchronously. This type of bean normally acts as a JMS message listener, which is similar to an event listener but receives JMS messages instead of events. The messages can be sent by any Java EE component (an application client, another enterprise bean, or a web component) or by a JMS application or system that does not use Java EE technology. Message-driven beans can process JMS messages or other kinds of messages

Client components do not locate message-driven beans and invoke methods directly on them. Instead, a client accesses a message-driven bean through, for example, JMS by sending messages to the message destination for which the message-driven bean class is the MessageListener. When a message arrives, the container calls the message-driven bean’s onMessage method to process the message.

Enterprise beans may be packaged within a EAR module as Java programming language class files or within a JAR file that is bundled within the EAR module, or it can be packaged within WAR module.

Jar contains ejb-jar.xml deployment descriptor. it must be located in the JAR module’s WEB-INF directory.

Figure 2-1 Fig. 1.0 [ejb-jar.xml]



The WebLogic Server weblogic-ejb-jar.xml deployment descriptor file describes the elements that are unique to WebLogic Server. Configuration of queue details, which mdb listener listen are mentioned here.

Figure 2-2 Fig. 2.0 [weblogic-ejb-jar.xml]