Sending a message to a message-driven bean
Message-Driven Beans (MDB) are used in an asynchronous fashion. A client will create a message and then send it to a queue for processing. The MDB will effectively remove the message from the queue and act on it.
In this recipe, we will use the
SalutationServlet to send a message to the queue each time a salutation is processed.
The process consists of two steps:
- Adding declarations for a queue factory and a message
- Adding code to actually send the message
SalutationApplicationproject as developed in the Accessing a session bean using dependency injection recipe. We will be modifying the
How to do it...
Start by adding declarations for a queue factory and a message ...