Hi, I am looking for a way to inject remote queues into my code in a similar way as is done with connection factories.
My environment:
JBoss 5.1 EAP in two clusters
- A messaging cluster that runs JBoss Messaging 1.4.7.GA
- An application cluster, that connects to the remote JMS on the messaging cluster. JBoss Messaging has been removed in the application cluster, and a remote JMS provider added.
The problem is the mapped name in the queue injection, a remote jndi lookup is needed to inject the queue.
My resource injection looks like this:
@Resource(mappedName="jnp://localhost:1199/jms/jb.itu.tes.jms.test.queue.b")
Destination jmdest;
We have four different environments, Development, Test, Staging and Production. And that requires different host:port configuration for each environment, because each environment has its own messaging cluster.
Is there a way to do the queue lookup in a similar way to the connection factory lookup? How do you inject remote resources in your code?
Here is the application cluster JMS configuration
<mbean code="org.jboss.jms.jndi.JMSProviderLoader"
name="jboss.messaging:service=JMSProviderLoader,name=RemoteJMSProvider">
<attribute name="ProviderName">RemoteJMSProvider</attribute>
<attribute name="ProviderAdapterClass">
org.jboss.jms.jndi.JNDIProviderAdapter
</attribute>
<tx-connection-factory>
<jndi-name>RemoteJmsXA</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:/RemoteJMSProvider</config-property>
<max-pool-size>20</max-pool-size>
<config-property name="UserName" type="java.lang.String">guest</config-property>
<config-property name="Password" type="java.lang.String">guest</config-property>
<security-domain-and-application>RemoteJmsXARealm</security-domain-and-application>
</tx-connection-factory>