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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access