本文描述了如何将Tibco Ent. for JMS代替JBoss-3.0.1RC1_Tomcat-4.0.4中的JBossMQ的方法。
首先,把tibjms.jar文件和tibjmsapps.jar文件拷入 server/default/lib目录下。
第二步,修改 server/default/deploy目录下的jms-service.XML文件,全文如下:
<?xml version="1.0" encoding="UTF-8"?>
<server>
<!-- ==================================================================== -->
<!-- Tibco JMS-->
<!-- ==================================================================== -->
<!-- For Message Driven Beans -->
<mbean code="org.jboss.jms.jndi.JMSProviderLoader" name= ":service=JMSProviderLoader,name=TibjmsProvider">
<attribute name="ProviderName">TIBCOJMSProvider</attribute>
<attribute name="ProviderAdapterClass">com.tibco.tibjms.appserver.jboss.JBossAdapter</attribute>
<attribute name="QueueFactoryRef">QueueConnectionFactory</attribute>
<attribute name="TopicFactoryRef">TopicConnectionFactory</attribute>
</mbean>
<mbean code="org.jboss.naming.NamingAlias" name="DefaultDomain:service=NamingAlias,fromName=QueueConnectionFactory">
<attribute name="ToName">tcp://localhost:7222/QueueConnectionFactory</attribute>
<attribute name="FromName">QueueConnectionFactory</attribute>
</mbean>
<mbean code="org.jboss.naming.NamingAlias" name="DefaultDomain:service=NamingAlias,fromName=TopicConnectionFactory">
<attribute name="ToName">tcp://localhost:7222/TopicConnectionFactory</attribute>
<attribute name="FromName">TopicConnectionFactory</attribute>
</mbean> <!-- The server session pool for Message Driven Beans -->
<mbean code="org.jboss.jms.asf.ServerSessionPoolLoader"
name="jboss.mq:service=ServerSessionPoolMBean,name=StdJMSPool">
<depends optional-attribute-name="XidFactory">jboss:service=XidFactory</depends>
<attribute name="PoolName">StdJMSPool</attribute>
<attribute name="PoolFactoryClass">
org.jboss.jms.asf.StdServerSessionPoolFactory
</attribute>
</mbean>
</server>
第三步:修改server/default/conf目录下的jndi.properties文件,
同样找到
Java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
替换成
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces:com.tibco.tibjms.naming
第四步:修改server/default/conf目录下的standardjboss.xml文件,同样找到
<JMSProviderAdapterJNDI>DefaultJMSProvider</JMSProviderAdapterJNDI>
换成:
<JMSProviderAdapterJNDI>TIBCOJMSProvider</JMSProviderAdapterJNDI>
再删除以下这段:
<DLQConfig>
<DestinationQueue>queue/DLQ</DestinationQueue>
<MaxTimesRedelivered>5</MaxTimesRedelivered>
<TimeToLive>0</TimeToLive>
</DLQConfig>
第五步:在server/default/deploy目录下,删除与jbossmq有关的两个文件:
jbossmq-service.xml
jbossmq-destinations-service.xml
(出处:http://www.knowsky.com)