1 Reply Latest reply on Jan 9, 2007 9:26 PM by Aaron Walker

    Redelivery caused by System.exit()?

    Longfang Q Newbie


      When our program receives a JMS message which instructs it to shut down, it calls System.exit(0). It works well with another application server. When we try to migrate to JBoss, we found that JMS message will not be consumed, which means the program does receive the message and exit but when it restarts, that JMS message will be redelievered and cause it to exit again and therefor an infinite loop.

      We use non-transactional messaging and auto acknolowledge:
      QueueSession qSession = qCon.createQueueSession(false,

      Can anyone kindly help? many thanks!

        • 1. Re: Redelivery caused by System.exit()?
          Aaron Walker Newbie

          Just a quick reply as I haven't look too deeply into this but you might want to try and invoke the shutdown of the server via JMX.

          The jboss.system:type MBean has a shutdown operation that you can invoke using JMX although this is a JBoss specific solution. I haven't try this from a MDB but it should work.

          In future can you please post these kind of questions to the JBoss Messaging User forum as they forum is for JBoss Messaging design related questions.