6 Replies Latest reply on Feb 28, 2008 10:05 AM by adrian.brock

    MDBs don't work after jms recovery

    kenubie

      Hi, I'm seeing this behavior on jboss 4.0.1.
      We have an MDB that listens for jms messages of a topic,
      so that messages are processed using the MDB's onMessage()
      method (as is standard usage). We found however that
      if the jms service is restarted (e.g. by touching the
      jms service.xml file to cause jms services to be redeployed),
      then even though our sender program recovers, all
      messages that are sent after the recovery do not trigger
      any MDB actions, it's as though no MDBs are triggered at all.
      To cause MDBs to work again, I actually have to redeploy
      the ear file. I dont' think this is acceptable behavior. What
      am I missing?

        • 1. Re: MDBs don't work after jms recovery
          genman


          I'm not sure what the use case is for redeploying the JMS subsystem. This may be something not supported by JBossMQ.

          If you can create a test case (unit test) and provide a patch, it can be fixed in an upcoming release.

          • 2. Re: MDBs don't work after jms recovery
            kenubie

            Actually I don't know what the fix is. My test case is very simple:
            1. write an mdb for a jms topic, process message in onMessage()
            2. write a sender for the topic
            3. deploy
            4. sender send messages, see that onMessages() got
            messages via print out in onMessages()
            5. touch the jboss jms service.xml file, this
            causes the jms destinations to be rebound again
            6. send messages again (no errors or exceptions)
            7. don't see any onMessage() printout at all from the MDBs
            anymore

            I don't see why this is not supported? given that
            if you are not using MDBs, you can have a jms receiver
            that catch jms exceptions and then reconnect. I thought
            MDBs should have handled any jms recovery automatically ?

            • 3. Re: MDBs don't work after jms recovery

              and my scenario is this:

              1. setup a jboss with mdb + queue in hajndi
              2. send messages every 5 minutes
              3. destroy queue from jmx (http://localhost:8080/jmx-console/HtmlAdaptor?action=inspectMBean&name=jboss.mq.destination%3Aservice%3DQueue%2Cname%3DmyQueue)
              4. create + start queue from jmx (same link)
              5. send messages with client ? sent OK to queue
              6. MDB does not reconnect in order to get the queue also when we do: 7. listReceivers() in the queue, we don?t see the MDB as a receiver. According to jboss configuration the MDB should have reconnected as far as I understand:
              10



              shouldnt the MDB reconnect automatically? anything i can do so that mdb will reconnect?

              10x

              Tomer

              • 4. Re: MDBs don't work after jms recovery

                Stopping destinations and getting clients to reconnect is an unsupported feature in JBossMQ.

                There is no mechanism to push the error to the client.

                One way to solve the problem (though it isn't very good) would be to
                close all connections that have active receivers
                (subscribers not receivers in BasicQueue) on the destination. This would cause
                the ExceptionListener to fire due to the lost connection.

                But this isn't implemented.

                • 5. Re: MDBs don't work after jms recovery
                  rbattu

                  Was this feature ever added?

                  Thanks
                  Ravi.

                  • 6. Re: MDBs don't work after jms recovery

                    As it says in READ THIS FIRST,
                    JBossMQ is not getting new features (unless you want to provide the patch?).
                    Try JBoss Messaging.