Need help with configuring message bridge from JBM-1.4.03SP3
karen.kramer Sep 5, 2008 8:48 AMWe are deploying an application on JBoss EAP 4.3.0 using JBM 1.4.0 SP3 and have successfully deployed with multiple queues and can successfully send messages and process them using MDB's.
We have one queue that needs to send messages to a queue that belongs to another internal application that is running in a standalone server JBOSS 4.0.5 with JMS that is JBossMQ. We thought that a messaging bridge would be the solution. (comments welcome here?)
So, I tried to follow the instructions that I found and did some other net surfing and came up with this:
1. test-bridge-service.xml:
<?xml version="1.0" encoding="UTF-8"?> <server> <mbean code="org.jboss.jms.server.bridge.BridgeService" name="jboss.messaging:service=Bridge,name=TestBridge" xmbean-dd="xmdesc/Bridge-xmbean.xml"> <!-- This SourceProviderLoader is for this application ..so I use the default provider --> <depends optional-attribute-name="SourceProviderLoader">jboss.messaging:service=JMSProviderLoader,name=JMSProvider</depends> <!-- This TargetProviderLoader is for connecting to the extenal application ...I've tried to define this in jms-ds.xml...this part is confusing me a bit --> <depends optional-attribute-name="TargetProviderLoader">jboss.messaging:service=JMSProviderLoader,name=MyRemoteJMSProvider</depends> <!-- Yes, these queues are named identically on both servers ! --> <attribute name="SourceDestinationLookup">/queue/DisputeStatusMessageQueue</attribute> <attribute name="TargetDestinationLookup">/queue/DisputeStatusMessageQueue</attribute> <attribute name="TargetUsername">guest</attribute> <attribute name="TargetPassword">guest</attribute> <attribute name="QualityOfServiceMode">0</attribute> <attribute name="MaxBatchSize">5</attribute> <attribute name="MaxBatchTime">-1</attribute> <attribute name="FailureRetryInterval">5000</attribute> <attribute name="MaxRetries">-1</attribute> <attribute name="AddMessageIDInHeader">false</attribute> </mbean> </server>
2. jms-ds.xml
I used this as a sample: http://wiki.jboss.org/wiki/JBMBridgeConfiguration
I'm not clear if MyRemoteJMSProvider should be using "messaging classes" or "JBossMQ" classes. Also, I don't think that I need HAJNDI, but otherwise how would you know the IP address and port number to connect to? I didn't see any other place to put that info.
<?xml version="1.0" encoding="UTF-8"?> <connection-factories> <!-- The JMS provider loader --> <mbean code="org.jboss.jms.jndi.JMSProviderLoader" name="jboss.jms:service=JMSProviderLoader,name=JMSProvider"> <attribute name="ProviderName">DefaultJMSProvider</attribute> <attribute name="ProviderAdapterClass"> org.jboss.jms.jndi.JNDIProviderAdapter </attribute> <!-- The combined connection factory --> <attribute name="FactoryRef">java:/XAConnectionFactory</attribute> <!-- The queue connection factory --> <attribute name="QueueFactoryRef">java:/XAConnectionFactory</attribute> <!-- The topic factory --> <attribute name="TopicFactoryRef">java:/XAConnectionFactory</attribute> <!-- Uncomment to use HAJNDI to access JMS <attribute name="Properties"> java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces java.naming.provider.url=localhost:1100 </attribute> --> </mbean> <mbean code="org.jboss.jms.jndi.JMSProviderLoader" name="jboss.messaging:service=JMSProviderLoader,name=MyRemoteJMSProvider"> <attribute name="ProviderName">RemoteXAConnectionFactory</attribute> <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute> <!-- The combined connection factory --> <attribute name="FactoryRef">XAConnectionFactory</attribute> <!-- The queue connection factory --> <attribute name="QueueFactoryRef">XAConnectionFactory</attribute> <!-- The topic factory --> <attribute name="TopicFactoryRef">XAConnectionFactory</attribute> <attribute name="Properties"> java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces java.naming.provider.url=192.168.1.172:1099 </attribute> </mbean> <!-- The server session pool for Message Driven Beans --> <mbean code="org.jboss.jms.asf.ServerSessionPoolLoader" name="jboss.jms: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> <!-- JMS XA Resource adapter, use this to get transacted JMS in beans --> <tx-connection-factory> <jndi-name>JmsXA</jndi-name> <xa-transaction/> <rar-name>jms-ra.rar</rar-name> <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition> <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property> <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property> <max-pool-size>20</max-pool-size> <security-domain-and-application>JmsXARealm</security-domain-and-application> </tx-connection-factory> </connection-factories>
3. Here's the provider that is sitting on the remote server..just the bean
<!-- The JMS provider loader --> <mbean code="org.jboss.jms.jndi.JMSProviderLoader" name="jboss.mq:service=JMSProviderLoader,name=JMSProvider"> <attribute name="ProviderName">DefaultJMSProvider</attribute> <attribute name="ProviderAdapterClass"> org.jboss.jms.jndi.JNDIProviderAdapter </attribute> <!-- The combined connection factory --> <attribute name="FactoryRef">java:/XAConnectionFactory</attribute> <!-- The queue connection factory --> <attribute name="QueueFactoryRef">java:/XAConnectionFactory</attribute> <!-- The topic factory --> <attribute name="TopicFactoryRef">java:/XAConnectionFactory</attribute> <!-- Uncomment to use HAJNDI to access JMS <attribute name="Properties"> java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces java.naming.provider.url=localhost:1100 </attribute> --> </mbean>
4. Deployment error