JMS and Message-Driven Bean
When a message-driven bean is deployed, it's assigned to handle messages from a specific topic or queue. Any messages sent by a JMS client (Java application, bean, or native client) will be forwarded by the message router to the message bean.
When a message is delivered to a message bean, one instance of that bean is selected by the EJB container from a pool to handle the message. The bean instance will receive the message when its
onMessage()
method is invoked and can process the message by
calling helper methods, or it may
invoke a session or entity bean to process the information in the message.