Configuring JMS in JBoss 5

jbosscorp_logo

This is again a small JMS configuration stuff we have to do in JBoss 5. There is considerable difference in doing it in JBoss 5 compared to JBoss 4 and don’t expect our old configuration to work well with JBoss 5 without any change. In JBoss 5 they are using JBoss Messaging in place of JBoss MQ. You can read a detailed post on migrating from JBoss 4 to JBoss 5 here.

This post is about the configuration of a simple queue. We can configure topics also like this. In JBoss 5, the configuration file is in messaging directory with in the deploy directory.

In JBoss 4.x the JMS configuration (in jms/jbossmq-destinations-service.xml) is like this:

<mbean code="org.jboss.mq.server.jmx.Queue"
 name="jboss.mq.destination:service=Queue,name=MyQueue">
 <attribute name="JNDIName">queue/MyQueue</attribute>
 <attribute name="RedeliveryDelay">10000</attribute>
 <attribute name="RedeliveryLimit">3</attribute>
 <depends optional-attribute-name="DestinationManager">
    jboss.mq:service=DestinationManager
 </depends>
</mbean>

In JBoss 5.x we should do this (in messaging/destinations-service.xml):

<mbean code="org.jboss.jms.server.destination.QueueService"
 name="jboss.messaging.destination:service=Queue,name=MyQueue"
 xmbean-dd="xmdesc/Queue-xmbean.xml">
 <depends optional-attribute-name="ServerPeer">
    jboss.messaging:service=ServerPeer
 </depends>
 <depends>jboss.messaging:service=PostOffice</depends>
 <attribute name="JNDIName">queue/MyQueue</attribute>
 <attribute name="RedeliveryDelay">10000</attribute>
 <attribute name="MaxDeliveryAttempts">3</attribute>
</mbean>

References:

JBoss Messaging:
http://www.jboss.org/file-access/default/members/jbossmessaging/freezone/docs/userguide-2.0.0.alpha1/html/performance.html

Migrating from JBoss 4 to JBoss 5:
http://venugopaal.wordpress.com/2009/02/02/jboss405-to-jboss-5ga/

You can check this URL also for configuration guidelines (JBoss Messaging 1.4.4):
http://www.jboss.org/file-access/default/members/jbossmessaging/freezone/docs/userguide-1.4.4.GA/html/configuration.html#conf.destination

Advertisements