Chapter 20. Message-Driven Beans

Message-driven beans are not a big leap from where we have been before. In Chapter 12, “The Java Message Service,” we introduced the JMS, and the idea of a message consumer that is activated by receipt of messages. Message-driven beans simply extend this capability to the EJB world, without changing very much else about the nature of the message consumer.

Where we will see a similarity to other EJB types is in the use of deployment descriptors, rather than embedded code, to configure aspects of our bean's behavior. With the earlier JMS examples, we coded directly into our classes the name of the Topic to which we wanted to connect. With the MDB, this will be configured as part of the deployment descriptor, giving ...

Get J2EE™ and JAX™: Developing Web Applications and Web Services 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.