2 Replies Latest reply on Nov 21, 2008 5:44 AM by secretdark

    HASingle (Barrier) Queue destination resolution

    secretdark

      Hi,

      Hoping for any kind of help with regards to resolving an issue with HASingleton Barrier queues (and hoping that this, rather than the Spring forum, is the appropriate place to seek help).

      I've defined two queues along these lines:

      <mbean code="org.jboss.mq.server.jmx.Queue"
       name="jboss.mq.destination:service=Queue,name=ErrorQueue">
       <depends>
       jboss.ha:service=HASingletonDeployer,type=Barrier
       </depends>
       <depends optional-attribute-name="DestinationManager">
       jboss.mq:service=DestinationManager
       </depends>
       <attribute name="InMemory">false</attribute>
      </mbean>
      


      I'm then deploying these across a 2 node cluster. This deploys correctly, with queues correctly failing over.
      I define these queues within my Spring configuration using the Clustered naming attribute described here http://docs.jboss.org/jbossas/guides/j2eeguide/r2/en/html_single/#d0e5915 , specifically the partition name.

      <bean id="jndiTemplate"
       class="org.springframework.jndi.JndiTemplate">
       <property name="environment">
       <props>
       <prop key="java.naming.factory.initial">
       org.jnp.interfaces.NamingContextFactory
       </prop>
       <prop key="java.naming.factory.url.pkgs">
       org.jnp.interfaces:org.jboss.naming
       </prop>
       <prop key="jnp.partitionName">Partition1</prop>
       </props>
       </property>
       </bean>
      


      Both instances are correctly named and a look through the logs shows HAJNDI resolving the queues correctly.

      However, when attempting to resolve the queues via a (Spring defined) listener, I'm incorrectly resolving the Destination on the node that does doesn't hold the running Singleton queue, resulting in an invalid destination exception.

      javax.jms.InvalidDestinationException: The destination QUEUE.ErrorQueue does not exist !
       at org.jboss.mq.server.ClientConsumer.addSubscription(ClientConsumer.java:140)
       at org.jboss.mq.server.JMSDestinationManager.subscribe(JMSDestinationManager.java:572)
       at org.jboss.mq.server.JMSServerInterceptorSupport.subscribe(JMSServerInterceptorSupport.java:171)
       at org.jboss.mq.security.ServerSecurityInterceptor.subscribe(ServerSecurityInterceptor.java:157)
      


      Presumably this is because the Listener is resolving to the local Queue Destination which is (as you'd expect) created but not started.
      The question is, therefor - is there a better way to resolve the correct destination?

      Thanks in advance for any help.