3 Replies Latest reply on Dec 31, 2003 4:40 AM by Adrian Brock

    How Durable MDBs work ?

    kevin101 Newbie

      I am trying to understand how the Durable MDBs work. How is the subscriber-id is used to receive messages between two JBoss servers ?
      Can the MDBs in two differnt JBoss servers have the same subscriber-id ?

      for eg: I have three JBoss servers running say JBossDallas, JBossLA and JBossSF.
      My JbossDallas is the server where all JMS messages are sent.
      JBossLA and JBossSF are having the same codebase but are running at different locations.
      Hence they have same subscriber-id.

      JBossSF and JBossLA has the RemoteJMSServer is set as the JBossDallas.

      My questions:
      1. Assume all JBoss are running. If a message is sent JBossDallas, is it automatically sent by JMSProvider to JBossSF and JBossLA ?
      2. Assume JBossLA is down when ten messages are being received by JBossDallas.
      when JBossLA is restarted after a day, will it get all the 10 messages ?

      I would appreciate if somebody can help.


      Thank you

        • 1. Re: How Durable MDBs work ?
          Adrian Brock Master

          You are using topics with durable subscriptions? e.g. in jboss.xml
          <mdb-client-id>JBossDallas</mdb-client-id>
          <mdb-subscription-id>whatever</mdb-subscription-id>

          Any message published to the topic will be stored on the server
          until the subscriber asks for it (pretty standard stuff).
          NOTE: You must make the initial subscription for this to work,
          either by the mdb connecting once or by configuring the durable subscription
          in conf/jbossmq-state.xml

          If you don't use durable subscriptions, any messages published when the
          subscriber is not connected will be lost.

          Regards,
          Adrian

          • 2. Re: How Durable MDBs work ?
            kevin101 Newbie

            Thank you Adrian, for response.

            I am using using durable subscriptions.

            You said
            Any message published to the topic will be stored on the server
            until the subscriber asks for it (pretty standard stuff).

            If the subscriber asks for the message from two instances of JBoss (JBossLA, JBossSF) with the same <mdb-subscription-id>whatever</mdb-subscription-id>,
            does both the subscribers receive message ? How does the server know what message to give to what subscriber ?

            Thanks for your help.

            • 3. Re: How Durable MDBs work ?
              Adrian Brock Master

              A durable subscription is a product of the client id and the subscription id.
              The client id has to be unique (only one client can be active with a given client id).
              Inside the client id, you can choose your own subscription ids.

              Regards,
              Adrian