JMS Adapters for JBM 2 Bridge
jmesnil Jan 7, 2009 7:15 AMI'm currently updating our BridgeService to make it work with JBM 2.
One of the task is to change the way we created JMS managed resources for the bridge's source and target (we no longer require the adapters to be registered in JMX).
In my local box, I've got a simple class JMSProviderAdapter which is instantiated by JBoss Microcontainer.
The Bridge & adapters configuration looks like:
<bean name="Bridge" class="org.jboss.messaging.jms.bridge.BridgeService"> <constructor> <parameter>TestBridge</parameter> <parameter> <inject bean="JMSManagementService"/> </parameter> </constructor> <property name="sourceProvider"> <inject bean="JBM_2_Provider"/> </property> <property name="targetProvider"> <inject bean="JBM_2_Provider"/> </property> <property name="sourceDestinationLookup">/queue/A</property> <property name="targetDestinationLookup">/queue/B</property> <property name="failureRetryInterval">-1</property> <property name="maxRetries">-1</property> <property name="maxBatchSize">1</property> <property name="maxBatchTime">-1</property> <property name="qualityOfServiceMode">2</property> <property name="transactionManager"> <inject bean="TransactionManager" /> </property> </bean> <bean name="JBM_2_Provider" class="org.jboss.messaging.jms.bridge.JMSProviderAdapter"> <constructor> <parameter>JBoss Messaging 2 Adapter</parameter> <parameter> <map class="java.util.Properties" keyClass="java.lang.String" valueClass="java.lang.String"> <entry> <key>java.naming.factory.initial</key> <value>org.jnp.interfaces.NamingContextFactory</value> </entry> <entry> <key>java.naming.provider.url</key> <value>jnp://localhost:1099</value> </entry> <entry> <key>java.naming.factory.url.pkgs</key> <value>org.jboss.naming:org.jnp.interfaces"</value> </entry> </map> </parameter> <parameter>/ConnectionFactory</parameter> </constructor> </bean> <bean name="TransactionManager" class="com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple"> </bean>
With this kind of configuration, I was able to bridge a JBM 1.4 source to a JBM 2 target (the bridge was hosted in the JBM2 server).
For each type of provider, you must add a bean description with all the JNDI properties required to lookup its JMS managed resources.
Then all the class must be in JBM 2 classpath when it is started.
I'm not familiar with JBM 1.4 Bridge configurations and I wanted to be sure that this way to configure JBM2 Bridge adapter is sufficient enough to cover all the cases.