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

    Sending message with delay

    Szymon Smyka Newbie

      Hi,

      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?

      Thanks,
      Szymon

        • 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"
           name="jboss.mq.destination:service=Queue,name=myqueue">
           <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>
           </mbean>
          


          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:

          http://www.jboss.org/wiki/Wiki.jsp?page=ConfigQueue&version=5

          This might help



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

            Moderated FAQ: scheduled delivery property