1

We are using ActiveMQ Scheduled Message feature to trigger events and process on time. If a cron scheduled at 00:00:00 every day, the event is having a brokerInTime something like 00:01:00. This is not the accurate time. Depending on the number of crons and number of messages published and also depending on the underlying box used, I understand that there will be a delay in the brokerInTime/brokerOutTime.

We have a requirement where while processing these messages, we need the exact schedule time (Feb 21, 00:00:00 in above example) at which its supposed to be triggered, instead of when its actually received by broker or dispatched.

Does activeMQ/JMS have any property that gives us Schedule time at which the cron is supposed to be triggered ??

Thanks.

santosh kumar
  • 131
  • 2
  • 7
  • Despite the fact that ActiveMQ 5.x supports this kind of scheduling functionality I would recommend against using and instead use a dedicated scheduler like [Quartz](http://www.quartz-scheduler.org/). See [this answer](https://stackoverflow.com/questions/56099275/scheduling-task-at-some-specific-time-in-java) for some additional details. – Justin Bertram Feb 21 '20 at 17:24

1 Answers1

2

There is no such property that the broker can apply, the OpenWire protocol only defines the BrokerInTime value which will reflect the time the message hits the queue. The scheduler makes a sort of best effort to process scheduled messages but is not to be treated as a real time event source. JMS 1.1 has no concept of scheduled messages at all, and the JMS 2.0 API doesn't define a specific field for this low level bit of detail either.

Tim Bish
  • 17,475
  • 4
  • 32
  • 42