1Z0-895 · Question #88
Which two statements are true JMS message-driven beans? (Choose two.)
The correct answer is A. The developer can use JMS message selector declarations to restrict the message that the bean receives. D. The developer can use the activationConfig element of the MessageDriven annotation to specify whether the. 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…
Question
Options
- AThe developer can use JMS message selector declarations to restrict the message that the bean receives.
- BThe developer can associate the bean with a specific queue or topic using the resource-ref element of the
- CTo achieve concurrent processing of more than one message at a time, more than one bean class must be
- DThe developer can use the activationConfig element of the MessageDriven annotation to specify whether the
How the community answered
(52 responses)- A83% (43)
- B6% (3)
- C12% (6)
Explanation
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 *a message-driven-destination, which contains the destination type (Queue or Topic) and the 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); } Developing message-driven beans Message Driven Beans Tutorial
Topics
Community Discussion
No community discussion yet for this question.