JBoss.org Community Documentation
You configure properties by using the <message-driven> element and sub elements which correspond to the
@ActivationConfigProperty
annotation.
ejb-jar.xml:
<message-driven> <ejb-name>ExampleMDB</ejb-name> <ejb-class>org.jboss.tutorial.mdb_deployment_descriptor.bean.ExampleMDB</ejb-class> <transaction-type>Bean</transaction-type> <message-destination-type>javax.jms.Queue</message-destination-type> <activation-config> <activation-config-property> <activation-config-property-name>acknowledgeMode</activation-config-property-name> <activation-config-property-value>AUTO_ACKNOWLEDGE</activation-config-property-value> </activation-config-property> </activation-config> </message-driven>
jboss.xml
<message-driven> <ejb-name>ExampleMDB</ejb-name> <destination-jndi-name>queue/tutorial/example</destination-jndi-name> </message-driven>
The queue/tutorial/example
is configured through the queue-example-service.xml
To build and run the example, make sure you have installed JBoss 5.x. See the Section 1.1, “JBoss Application Server 5.x” for details.
From the command prompt, move to the "mdb_deployment_descriptor" folder under the Section 1.3, “Set the EJB3_TUTORIAL_HOME”
Make sure your JBossAS-5.x is running
$ ant $ ant run run: [java] Message sent successfully to remote queue.
$ mvn clean install -PRunSingleTutorial
On the server console, you will notice the following logs:
23:37:38,175 INFO [STDOUT] ---------------- 23:37:38,175 INFO [STDOUT] Received message 23:37:38,175 INFO [STDOUT] ----------------