In order to create a message driven bean, we need to right-click on our EJB project and select New | Message Driven Bean. In the resulting dialog window, we need to enter a name, package, and select a JMS destination for the message driven bean.
Once we have entered all the required information, our message driven bean is created in the specified package.
package com.ensode.mdb; import javax.ejb.ActivationConfigProperty; import javax.ejb.MessageDriven; import javax.jms.Message; import javax.jms.MessageListener; @MessageDriven(mappedName = "jms/myQueue", activationConfig = { @ActivationConfigProperty( propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"), @ActivationConfigProperty( propertyName = "destinationType", propertyValue = "javax.jms.Queue") }) public class MessageReceiverBean implements MessageListener { public MessageReceiverBean() { } public void onMessage(Message message) { } }
In the generated code, all we need...