1 Reply Latest reply: Mar 15, 2012 7:48 PM by James Davis RSS

How to send message to non-local JMS queue

James Davis Newbie

I'm a little new to JMS, so please forgive me if I am missing something here.

 

Basicaly what I have here is a cluster of three JBoss SOA-P 5.1 boxes.  I have all of them sharing the same database instance and all appears to be working well from the cluster standpoint.  The main issue that I'm having is a service I have running publishes out JMS messages to distribute work out to the various nodes in the cluster.  I am getting (or trying to get) the HA JNDI factory to grab these queues from then using that to send the messages.

 

However, all of the messages only go to the local queue, not the clustered versions of them.  Is it possible that I have something mis-configured here? 

 

I am using spring to inject my connection factory into my service... Here are my spring bean defs for them:

 

    <bean id="haJndiTemplate" class="org.springframework.jndi.JndiTemplate">
        <property name="environment">
            <props>
                <prop key="javax.naming.factory.initial">org.jnp.interfaces.NamingContextFactory</prop>
                <prop key="javax.naming.factory.url.pkgs">jboss.naming:org.jnp.interfaces</prop>
               <!-- configured using spring property placeholder config -->
                <prop key="javax.naming.provider.url">jnp://${jms.connection.hosts}</prop>
            </props>
        </property>
    </bean>


    <bean id="myQueue" class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiTemplate" ref="haJndiTemplate" />
        <property name="jndiName" value="queue/myQueue />
    </bean>


    <bean id="jmsConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiTemplate" ref="haJndiTemplate" />
        <property name="jndiName" value="/XAConnectionFactory" />
    </bean>

 

I am using the jmsConnectionFactory to create the session & connection to send these messages, but is it possibly due to the queue (myQueue) somehow not getting pulled from the HA JNDI?