This question is regarding setting a delivery time in a message (in the JMS header). I went through the javax.jms.* package and could not find anything that would enable me to set a time for my message delivery. The closest I got to this was the weblogic.jms.extensions.WLMessage message interface in the Weblogic API specifications. This particular interface has the getter and setter methods for doing such a thing Now, my question is - Where can I find an example of how to use this in an application ? In other words, how do I go about creating a WLMessage ? For example, the Session interface in javax.jms.* provides methods to create a TextMessage, ObjectMessage ... and so on. Is there something similar to create a WLMessage... ? Pls. help... this is quite urgent. thanks
Setting messages to be sent at specific times is not covered by the JMS specification and you can't use the methods of WLMessage to accomplish what you would like to do. If you read the javadocs for WLMessage.setJMSDeliveryTime it says:
Set the delivery time for the message; this method is for use by providers only, and is called automatically when a message is sent. When the message is sent, the current redelivery time is over-ridden.
Therefore no matter what you set the delivery time to be, it is going to be over-ridden by WebLogic. The question I have for you is what exactly are you trying to achieve? If it is just scheduling jobs to run at specific times then I suggest you look into using a JMX Timer MBean. I have written a simple JMX-based job scheduler and it works very well (and it is portable among App Servers). If you need advanced job scheduling than I suggest you look into open-source Quartz or Flux.
If you believe you can tell me what to think, I believe I can tell you where to go. Go read this tiny ad!