8.3. Designing Message-Driven Beans

Now that we've introduced you to JMS, let's learn about message-driven beans. Simply put, a message-driven bean is an asynchronous consumer of JMS messages. Message-driven beans are stateless, server-side, transaction-aware components that receive messages from a JMS topic or queue. Like stateless session beans, message-driven beans do not store conversational state. They do not have a home or remote interface, nor do they have any business methods.

Figure 8-6 shows how a client interacts with a message-driven bean. When a message is sent from the client to a topic or queue destination in the JMS server, the EJB container fetches a bean instance from the message-driven bean pool. The container reads the message ...

Get Enterprise JavaBeans™ Component Architecture: Designing and Coding Enterprise Applications 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.