I am putting messages on a queue with a scheduled delivery time. In one use case I need to remove a message that has been scheduled, but not delivered.
I know that I can create a message selector with the JMSMessageID to select a particular message off -- but that does not seem to work for pending messages.
After looking at the src, it looks like receive() does not look at any pending messages, which does make complete sense (message is not actually on the queue).
So, is there an undocumented way to peek in to the scheduled stack of messages on a queue and receive them?
There isn't a way to retrieve them unfortuantely. There is a way to remove all scheduled messages. You can simply add a message selector that prevents receiving that particular message when it is actually added to the queue.