![]() |
This example MDB uses container-managed transactions. For more information, see Container-Managed Transactions (XA).
|
queue/A
, queue/B
and queue/DLQ
) and two XA connection factories (XAQueueConnectionFactory
and XATopicConnectionFactory
), by entering the following commands in tibemsadmin
:> connect > create queue queue/A > create queue queue/B > create queue queue/DLQ > create factory XAQueueConnectionFactory xaqueue url=tcp://7222 > create factory XATopicConnectionFactory xatopic url=tcp://7222
%JBOSS_DEPLOY%\jms\jms-ds.xml
%JBOSS_CONF%\jboss-service.xml
%JBOSS_CONF%\standardjboss.xml
<mdb output>
\META-INF\jboss.xml
CLASSPATH
of the JBoss server by modifying the file %JBOSS_CONF%\jboss-service.xml
as described below. Substitute an appropriate JAR file CLASSPATH
for your installation.
Add the following lines under the <server>
element in the file %JBOSS_CONF%\jboss-service.xml
:
<!-- TIBCO Enterprise Message Service classpath --> <classpath codebase="file:/C:\TIBCO\EMS\clients\java" archives="tibjms.jar" />
JMSProviderLoader
mbean to load TIBCO Enterprise Message Service instead of JBoss MQ. To do so, edit the file %JBOSS_DEPLOY%\jms\jms-ds.xml
to resemble these lines:<!-- The JMS provider loader --> <mbean code="org.jboss.jms.jndi.JMSProviderLoader" name=":service=JMSProviderLoader,name=TibjmsProvider"> <attribute name="ProviderName">TIBCOJMSProvider</attribute> <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute> <attribute name="QueueFactoryRef">XAQueueConnectionFactory</attribute> <attribute name="TopicFactoryRef">XATopicConnectionFactory</attribute> <attribute name="Properties"> java.naming.security.principal=jbosslookup java.naming.security.credentials=jbosslookup java.naming.factory.initial=com.tibco.tibjms.naming.TibjmsInitialContextFactory java.naming.factory.url.pkgs=com.tibco.tibjms.naming java.naming.provider.url=tibjmsnaming://localhost:7222 </attribute> </mbean>
QueueConnectionFactory
(in order to create a QueueSender
to send a message back to the initiator), it looks it up as java:comp/env/jms/QCF
. Because we want the QueueConnectionFactory
object that is returned from the lookup to be a TIBCO Enterprise Message Service XAQueueConnectionFactory
, we must store a JNDI LinkRef under that name in the JBoss JNDI implementation that points to the XAQueueConnectionFactory
in the TIBCO Enterprise Message Service implementation. Adding the following lines in %JBOSS_DEPLOY%\jms\jms-ds.xml
accomplishes this.<!-- Redirect QueueConnectionFactory to TIBCO Enterprise Message Service --> <mbean code="org.jboss.naming.NamingAlias" name="DefaultDomain:service=NamingAlias,fromName=QueueConnectionFactory"> <attribute name="ToName">tibjmsnaming://localhost/XAQueueConnectionFactory </attribute> <attribute name="FromName">QueueConnectionFactory</attribute> </mbean>
SendRecvClient
test program looks up the ConnectionFactory
referenced in the test program, it needs to be redirected to the appropriate QueueConnectionFactory
configured in EMS. Add the following lines in %JBOSS_DEPLOY%\jms\jms-ds.xml
to accomplish this.<mbean code="org.jboss.naming.NamingAlias" name="DefaultDomain:service=NamingAlias,fromName=ConnectionFactory"> <attribute name="ToName">tibjmsnaming://localhost/QueueConnectionFactory </attribute> <attribute name="FromName">ConnectionFactory</attribute> </mbean>
tibjmsnaming
scheme, the server must be able to find the TIBCO Enterprise Message Service URLConnectionFactory
. Therefore, modify the file %JBOSS_CONF%\jndi.properties
as follows:
This change sets "TIBCOJMSProvider
" as the JMS Provider Adapter JNDI name.
This change specifies the TIBCO Enterprise Message Service JNDI name for the MDB Dead Letter Queue (DLQ) queue/DLQ
.
%JBOSS_DEPLOY%
directory. These files are not needed when using TIBCO Enterprise Message Service and therefore must not be deployed:%JBOSS_CLIENT%\jndi.properties
to use TIBCO Enterprise Message Service JNDI by setting the following property:C:\TIBCO\EMS\clients\java\tibjms.jar
to the CLASSPATH
of the client program.
TIBCO Enterprise Message Service™ Application Integration Guide Software Release 4.3, February 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |