2 Replies Latest reply on Mar 11, 2005 4:08 PM by Adrian Brock

    Sending message with delay

    Szymon Smyka Newbie


      We need to send messages with specified delay. The message should not be visible for the consumers before the delay time.

      In weblogic we used the vendor specific API for this: weblogic.jms.extensions.WLMessageProducer.setTimeToDeliver(n).

      Is there something similary for JBoss?


        • 1. Re: Sending message with delay
          harm laat, de Newbie

          I'm not aware of any initial delay.

          But you can set the redeliver delay:

          <!-- Queue where APILinkProxy messages are sent to -->
          <mbean code="org.jboss.mq.server.jmx.Queue"
           <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
           <attribute name="ReceiversImpl">org.jboss.mq.server.ReceiversImplArrayList</attribute>
           <attribute name="RedeliveryDelay">1000</attribute>
           <attribute name="RedeliveryLimit">3</attribute>

          So, I guess you could do an immediate NACK after receiving the message the message the first time. (You can check using the msg.getJMSRedelivered() method), and set a redeliver delay...

          Also take a look at:


          This might help

          • 2. Re: Sending message with delay
            Adrian Brock Master

            Moderated FAQ: scheduled delivery property