4 Replies Latest reply on Oct 5, 2003 2:01 PM by nic7834

    Message scheduling how?  Step by step.

    nic7834

      Hi there

      Could someone please explain how to schedule the delivery time of a JMS message step by step. I don't understand how to use the JBoss specific features that are supposed to be in 3.2.2RC2 and above (see extract below).

      How is the property supposed to be set and what format is the delivery time supposed to be in? Sample code appreciated.

      Thanks all!
      Nic Lai

      ======================================
      Extract from this forum:
      ======================================
      http://sourceforge.net/tracker/index.php?func=detail&aid=744455&group_id=22866&atid=381174


      Applied a patch which adds the following JBoss
      vendor-specific JMS properties:

      "JMS_JBOSS_SCHEDULED_DELIVERY";
      "JMS_JBOSS_REDELIVERY_DELAY";
      "JMS_JBOSS_REDELIVERY_COUNT";
      "JMS_JBOSS_REDELIVERY_LIMIT";

      1. Scheduled delivery, paused (delayed) re-delivery
      2. Track number of delivery attempts of a message
      3. Set maximum delivery attempts per message
      4. Proactively expire messages, without having to
      restore the whole message from disk if cached. Also, the
      same timer thread which handles scheduled messages proactively "reaps" expired messages.

        • 1. Re: Message scheduling how?  Step by step.

          There's always a workaround when one search a little bit.

          Have you checked the changelog and the CVS? I am pretty sure the information is there

          In the latter case, the testsuite should definitely contains tests of this new feature (and you have your code snippet in that case)

          Let us know if you find something.

          Regards,

          Stephane

          • 2. Re: Message scheduling how?  Step by step.

            You simple set the scheduled delivery property to the time
            after which you want it delivered.

            static long ONE_HOUR_MILLIS = 60 * 60 * 1000;

            long now = System.currentTimeMillis();
            mesasge.setLongProperty("JMS_JBOSS_SCHEDULED_DELIVERY", now + ONE_HOUR_MILLIS);

            NOTE: The clocks of the machines need to be "synchronized" to
            avoid suprises. By synchronized I mean the calculation is done in CUT (system time + timeZoneOffset)

            Regards,
            Adrian

            • 3. Re: Message scheduling how?  Step by step.
              nic7834

              Thanks for the reply guys,

              I will give it a go when I get a chance to try it out on 3.2.2RC4. It seems some changes have been made to the way primary keys are auto generated so something is broken.

              Nic

              • 4. Re: Message scheduling how?  Step by step.
                nic7834

                ... in my application.

                Nic