Looking Under the Hood of an MDB

Figure 14.1 shows the interactions between the client, the JMS service, the EJB container, and the message-driven bean.

Figure 14.1. Under the hood of a message-driven bean.

The following steps describe the sequence of interactions in detail:

1.
At startup, the JMS service registers all JMS Destinations (Topic or Queue) with the Java Naming and Directory Interface (JNDI) service. The EJB container also registers the message-driven beans as JMS consumers with the JMS service.
2.
The EJB container decides to instantiate a message-driven bean based on the caching policy. For example, the EJB container instantiates ...

Get Sams Teach Yourself EJB in 21 Days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.