0 Replies Latest reply on Jan 9, 2007 1:18 PM by Tim Fox

    Scheduled delivery and redelivery delay

    Tim Fox Master

      Scheduled delivery and redelivery delay are now implemented in TRUNK.

      Scheduled delivery:

      Before sending a message you can set a JBoss specific property - this is the same property name used by JBoss MQ:

      message.setLongProperty("JMS_JBOSS_SCHEDULED_DELIVERY", System.currentTimeMillis() + 30000);

      Then after the message has successfully reached the queue, delivery will not occur until the specified future time. This could be milliseconds, seconds or months
      in the future. If the message is persistent and the message is in a jms queue or durable subscription, then the scheduled delivery will survive a restart.

      Clearly scheduled message deliveries do not respect normal message orderings in queues.

      Delayed redelivery:

      Often it is useful to introduce a delay before redelivery of a message. E.g. if a consumer fails often it may not be desirable to have a message redelivered in quick
      succession due to the extra network traffic that might give.

      A redelivery delay can be specified for the server which would apply to all destinations. Specific delays can also be specified on a per destination basis which
      overrides any value specified at the server level.

      Internally, both scheduled delivery and redelivery delay use the same mechanism to delay deliveries.