1 Reply Latest reply on Oct 29, 2003 2:21 AM by Adrian Brock

    Same MDB Subscriber Deployed On Multiple Server Question

    joshlam Newbie

      We have a situation in which we have to deploy the same MDB on multiple machines for fail over/load balancing purposes. One of the MDB is a subscriber to a certain topic, however, this MDB will be deployed on at least two separate machines running jBoss 3.2.2.

      Is there a way to prevent an MDB subscriber to receive and process a topic if the other one got it first? We just don't want to process a topic twice.

      Thanks,

        • 1. Re: Same MDB Subscriber Deployed On Multiple Server Question
          Adrian Brock Master

          You might be able to use two new features available in 3.2
          to do this.

          1) You can deploy the mdbs in an inactive state.
          Using the following invoker-proxy-binding config:

          <invoker-proxy-binding>
          inactive-message-driven-bean
          <invoker-mbean>default</invoker-mbean>
          <proxy-factory>org.jboss.ejb.plugins.jms.JMSContainerInvoker</proxy-factory>
          <proxy-factory-config>
          DefaultJMSProvider
          StdJMSPool
          15
          1

          10
          false <!-- !! HERE !! -->

          queue/DLQ
          10
          0


          </proxy-factory-config>
          </invoker-proxy-binding>

          2) Write a HASingleton to enable delivery on one node,
          this is a JMX invocation on the MDB invoker
          http://www.onjava.com/pub/a/onjava/2003/08/20/jboss_clustering.html?page=1

          You will find the MDB invoker in the jboss.j2ee domain
          on http://localhost:8080/jmx-console
          It will have binding=inactive-message-driven-bean
          if you used the above config.
          You will notice the start/stopDelivery operations.

          One question, are these durable subscriptions?
          You should not be able to connect to the same durable
          subscription twice, since that would require you to use
          the same ClientID on two different connections.
          You should receive an error message when the
          second connection tries to connect.

          Regards,
          Adrian