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

    HASingle (Barrier) Queue destination resolution

    Ryan Bateman Newbie


      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"
       <depends optional-attribute-name="DestinationManager">
       <attribute name="InMemory">false</attribute>

      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"
       <property name="environment">
       <prop key="java.naming.factory.initial">
       <prop key="java.naming.factory.url.pkgs">
       <prop key="jnp.partitionName">Partition1</prop>

      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.