7.10. Deploying JMS Destinations on JBoss
JBoss implements and manages JMS Queues and Topics as JMX MBeans that create the Destination and register its JNDI name. Here are a few options for creating an MBean for our Queue:
We created our own service file because we wanted your JMS destination settings to survive JBoss startup/shutdown, and we didn't want to co-mingle your application-specific JMS Destinations with JBoss-internal Destinations. Co-mingling destinations is bad because each time you upgrade to a new version of JBoss, you have to re-add the <mbean> elements to your service descriptor to make things work again. Example 7-9 shows the jaw-jms-destinations.xml file that creates an MBean for the CreditCheckQueue.
Example 7-9. jaw-jms-destinations.xml
<?xml version="1.0" encoding="UTF-8"?> <server> <mbean code="org.jboss.mq.server.jmx.Queue" name="jboss.mq.destination:service=Queue,name=CreditCheckQueue"> <depends optional-attribute-name="DestinationManager"> jboss.mq:service=DestinationManager </depends> </mbean> </server>
To deploy our Queue to JBoss, the Ant build script copies the jaw-jms-destinations-service.xml file from the ch07/src/META-INF directory to the JBoss deployment directory$JBOSS_HOME/server/default/deploy.