-
1. Browse delayed messages
clebert.suconic May 1, 2011 12:46 PM (in response to rhinmass)You can use Management operations to look at those.
those are not delivered yet, right? Hence you can't look at those on the queue through the browsers. It doesn't make sense
-
2. Browse delayed messages
rhinmass May 1, 2011 3:42 PM (in response to clebert.suconic)Thanks Clebert. How can I look at those message using management operations? I could only find javax.management.j2ee.statistics.getPendingMessageCount(), but that is just the count. Is there a way to peek at the actual message?
If so, can you point me at the class I would need to use?
-
3. Browse delayed messages
rhinmass May 1, 2011 3:50 PM (in response to rhinmass)OK, I just found QueueControl.listScheduledMessages(). I was looking in the javax.*, rather than the org.hornetq.* But since "_HD_SCHED_DELIVERY" is not jms standard anyway, it makes sense I will need to go implementation-dependent.
-
4. Browse delayed messages
clebert.suconic May 2, 2011 2:03 AM (in response to rhinmass)As I said, With Scheduled Message you are saying send at a later time. The message didn't make to the JMS queues yet.
-
5. Browse delayed messages
rhinmass May 2, 2011 7:52 AM (in response to clebert.suconic)Clebert Suconic wrote:
You can use Management operations to look at those.
Which management operation can be used to look at the scheduled messages?
-
6. Browse delayed messages
rhinmass May 3, 2011 9:19 AM (in response to rhinmass)I figured out how to this:
MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
SimpleString queueId = new SimpleString("jms.queue.MyQueue");
ObjectName on = ObjectNameBuilder.DEFAULT.getQueueObjectName(queueId, queueId);
Map<String,Object>[] maps =
(Map<String,Object>[]) mBeanServer.invoke(on, "listScheduledMessages", new Object[0], new String[0]);
for (Map<String,Object> map : maps)
{
long schedTime = ((Long)map.get("_HQ_SCHED_DELIVERY")).longValue();
System.out.println("message " + map.get("messageID") + "is scheduled for delivery on " + new Date(schedTime));
}