I need different delay for different messages based on special conditions. Is there a way to set the delivery delay in a message header using TIBCO EMS like in ActiveMQ?
MessageProducer producer = session.createProducer(destination);
TextMessage message = session.createTextMessage("test msg");
if (condition) {
long time = 60 * 1000;
message.setLongProperty(ScheduledMessage.AMQ_SCHEDULED_DELAY, time);
}
producer.send(message);
If Tibco EMS supports JMS 2 then you can use javax.jms.MessageProducer#setDeliveryDelay(long)
:
MessageProducer producer = session.createProducer(destination);
TextMessage message = session.createTextMessage("test msg");
if (condition) {
long time = 60 * 1000;
producer.setDeliveryDelay(time);
}
producer.send(message);