1 Reply Latest reply on Jul 6, 2004 2:15 AM by nic7834

    Load balanced MDBs on cluster: subscription problems?

    nic7834 Newbie


      I am following the wiki:

      Have successfully:
      1. Setup 2 node cluster, with HA MQ on master node
      2. Got JMS authentication/authorization using database
      3. Deployed JMS producer/consumer on master node (with JMS persistence to database)

      Problem is that when i deploy the same package on the second node, the MDBs there try to connect on the same durable subscription:

      2004-07-05 13:19:35,842 INFO [org.jboss.ejb.plugins.jms.JMSContainerInvoker] Reconnected to JMS provider
      2004-07-05 13:19:35,842 WARN [org.jboss.ejb.plugins.jms.JMSContainerInvoker] JMS provider failure detected:
      javax.jms.IllegalStateException: The durable subscription is already in use. DurableSubscription[clientId=MonitorUID1 name=MonitorDS selector=null]
      at org.jboss.mq.server.JMSTopic.addSubscriber(JMSTopic.java:75)
      at org.jboss.mq.server.ClientConsumer.addSubscription(ClientConsumer.java:133)
      at org.jboss.mq.server.JMSDestinationManager.subscribe(JMSDestinationManager.java:601)
      at org.jboss.mq.server.JMSServerInterceptorSupport.subscribe(JMSServerInterceptorSupport.java:297)
      at org.jboss.mq.security.ServerSecurityInterceptor.subscribe(ServerSecurityInterceptor.java:142)
      at org.jboss.mq.server.TracingInterceptor.subscribe(TracingInterceptor.java:816)
      at org.jboss.mq.server.JMSServerInvoker.subscribe(JMSServerInvoker.java:297)
      at org.jboss.mq.il.uil2.ServerSocketManagerHandler.handleMsg(ServerSocketManagerHandler.java:160)
      at org.jboss.mq.il.uil2.SocketManager$ReadTask.handleMsg(SocketManager.java:356)
      at org.jboss.mq.il.uil2.msgs.BaseMsg.run(BaseMsg.java:377)
      at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748)
      at java.lang.Thread.run(Thread.java:534)

      I understand that the MDBs on the master node are using up the durable subscription ID. My question is how am I supposed to get unique subscription IDs for each node when the cluster is increased.

      Something like this:

      String randomClientID = generateRandomID();
      topicSession.createDurableSubscriber(topic, "MySubscriptionName");

      I don't think this can work because of the JMS authentication in place. Should I just use the guest account then?


        • 1. Re: Load balanced MDBs on cluster: subscription problems?
          nic7834 Newbie

          Following this up...I've got the issue confused !!!

          To clarify, I'm looking at load balancing by deploying an MDB on 2 nodes in a cluster with the master node running HAJMS. What i want is for each of msgA, msgB, msgC, etc. posted on a topic to be handled once and only once by either the MDB on the master node or the secondary node. For this, the MDB is configured as a durable subscriber with "MonitorUID1".

          Logically I can't use different client IDs for the durable subscriptions if I want each message handled once only (and not by all MDBs on all nodes).

          So what I really want is the MDB on the master and secondary nodes to be seen as connecting to the topic under the same durable subscription client ID.

          Does any one know how to do this?