Correct Answer: A,D
Explanation/Reference:
A: Elements in the deployment descriptor
The description of a MDB (message-driven beans) in the EJB 2.0 deployment descriptor contains the following specific elements:
* the JMS acknowledgement mode: auto-acknowledge or dups-ok-acknowledge
* an eventual JMS message selector: this is a JMS concept which allows the filtering of the messages sent to the destination
* a message-driven-destination, which contains the destination type (Queue or Topic) and the subscription D: Example:
The following example is a basic message-driven bean:
@MessageDriven(activationConfig={
@ ActivationConfigProperty(propertyName="destination", propertyValue="myDestination"),
@ ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue")
})
public class MsgBean implements javax.jms.MessageListener {
public void onMessage(javax.jms.Message msg) {
String receivedMsg = ((TextMessage) msg).getText();
System.out.println("Received message: " + receivedMsg);
}
}
Reference: Developing message-driven beans
Reference: Message Driven Beans Tutorial