Search code examples
javaactivemq-classic

Is there any way to specify time zone for scheduled active mq message?


I want to use activeMQ to scheduled message with cron expression and able to do that with UTC time zone but the problem is that, messages should be scheduled based on users timezone, each user have there different timezone.

Is there any way to specify timezone in activeMQ with each message?

I tried this message.setStringProperty("CRON_TZ", timeZone); but not working

MessageCreator message = new MessageCreator() {
  @Override
  public Message createMessage(Session session) throws JMSException {
       Message message = session.createTextMessage(text);               
       message.setStringProperty(ScheduledMessage.AMQ_SCHEDULED_CRON, cron);                
       return message;

}


Solution

  • No there isn't any support for other time zone values in the scheduler API. The scheduler uses UTC time by design and it is up to your application layer to translate that into local timezone for your users.