I am new to this forum. I Hope that I can get a solution to the problem that is bugging me for a long time.
I am using JBoss the application server and using the default JMS service provided by it.
I need a mechanism where a JMS message can be created instantly as required but delivered in the future. I mean I will create a JMS message and must be able to specify the exact amount of time after which it has to be delivered. Please note that the amount of time may vary depending on the content of the messsage.
Can you please help me to take over this problem?
Delivery time may be useful for scheduling JMS messages. Unfortunately AFAIK there is no portable way to set delivery time for JMS messages. The following code shows how to schedule a JMS message for Weblogic and JBoss server:
queueConnection = queueConnectionFactory.createQueueConnection();
QueueSession queueSession = queueConnection.createQueueSession(true, 0);
QueueSender queueSender = queueSession.createSender(queue);
ObjectMessage jmsMsg = queueSession.createObjectMessage(message);
//Casts queueSender to weblogic.jms.extensions.WLMessageProducer interface and set delivery time
//Setting JMS_JBOSS_SCHEDULED_DELIVERY message property
Hope it helps.
If your application server is other than weblogic and jboss
then you can use of EJB Timers to schedule ur message delivery.