Search code examples
c#.netactivemq-classicnms

Delayed delivery with ActiveMQ 5.3 and NMS


I'm attempting to use the new delayed delivery functionality from NMS.

The schedulerSupport attribute has been set in the config file, and I'm using the following code to attempt to delay delivery of a message until the date/time chosen by the user is reached.

The code (which does not seem to be working currently) is as follows:

var timeDelay = dateTimePicker.Value.Subtract(DateTime.Now).TotalMilliseconds;     
var message = topicPublisher.CreateTextMessage();
message.Properties["AMQ_SCHEDULED_DELAY"] = timeDelay;
message.Text = CM.ToXMLString();

topicPublisher.Send(message);

Can you point out what might be incorrect within this example?

Many thanks!


Solution

  • I don't see anything obvious from the code provided.

    You could try turning up the logging in the broker to see if the scheduler receives the message and that the values are correct, that would also confirm that you have indeed enabled scheduler support. You could also try creating a small java program that does something similar to determine if the NMS client is behaving correctly.

    I assume you have a consumer running and its connection object has been started?

    Regards Tim.

    www.fusesource.com