-
1. Re: Scheduled messages in HornetQ
clebert.suconic Jun 1, 2011 10:32 AM (in response to p_b_k)In JBoss5 I was able to get and display the message body as well.
How you were doing that? what method? In JBoss Messaging?
-
2. Re: Scheduled messages in HornetQ
p_b_k Jun 1, 2011 10:54 AM (in response to clebert.suconic)The same method listScheduledMessages() then returned List<javax.jms.Message> and I could get the whole message. Now, as I see, listScheduledMessages() returns maps only of message headers.
I only want to know if in HornetQ it's possible to see the whole scheduled message or not, in order to change my code accordingly.
-
3. Re: Scheduled messages in HornetQ
clebert.suconic Jun 1, 2011 11:14 AM (in response to p_b_k)I don't think listScheduledMessages ever returned the message on the management operation.
If you are inside the same server, you would be able to find the PostOfficeImpl and play directly with QueueImpl, and call getScheduledMessages there.
I don't think it makes sense to return the whole message on QueueImpl::getScheduledMessage.
You can however "hack" your version and add the method yourself on QueueControlImpl / QueueControl interface. And we may consider adding the method if you proof a good use case.
-
4. Re: Scheduled messages in HornetQ
p_b_k Jun 2, 2011 7:12 AM (in response to clebert.suconic)Thanks, but since I am new to HornetQ - how do I get the PostOfficeImpl?
-
5. Re: Scheduled messages in HornetQ
clebert.suconic Jun 2, 2011 10:47 AM (in response to p_b_k)You would need to do it outside of JMX. Through JBoss Micro Container, getting the Bean by its name on hornetq-jboss-beans.xml.
Do you really need that? The reason we didn't add it to management is because Messages are not serializable and you can't access the operation outside of JBoss.
-
6. Re: Scheduled messages in HornetQ
p_b_k Jun 3, 2011 7:57 AM (in response to clebert.suconic)Well, that's how I was getting the whole scheduled messages before:
Hashtable<String, String> attributes = new Hashtable<String, String>(2);
attributes.put("name", queueName);
attributes.put("service", "Queue");
ObjectName objectName = new ObjectName("jboss.mq.destination", attributes);
List<Message> scheduledMessages = (List<Message>)mbServer.invoke(objectName, "listScheduledMessages", new Object[]{}, new String[]{});
And this returned the whole messages. Isn't there a similar way now? If not, or if it's too complicated, I'll consider changing the program to show only the properties.
-
7. Re: Scheduled messages in HornetQ
clebert.suconic Jun 3, 2011 10:01 AM (in response to p_b_k)That was jboss-mq/JBoss Messaging. We don't want to support that on HornetQ
-
8. Re: Scheduled messages in HornetQ
clebert.suconic Jun 3, 2011 12:16 PM (in response to clebert.suconic)1 of 1 people found this helpfulI don't have an example now... but if you used JBoss Micro Container methods, you would be able to locate the bean named HornetQServer,
With an instance of HornetQServer, you would be able to:
horneTQServer.locateQueue(SimpleString queueName).getScheduledMessages();
However... what you're doing is really a hack. You are invading the messaging implementation (as you were before) to get the list of scheduled messages.
I would review your testcase to see if you really need that.
You probably are aa good on google as I am. Look for Kernel and Micro Container, and find a method to access the HornetQServer, you will have to use the name defined on horentq-beans.xml.
-
9. Re: Scheduled messages in HornetQ
rhinmass Jun 21, 2011 9:29 AM (in response to clebert.suconic)I am also using the "hack" described above, but would like to change my ways and use
hornetQServer.locateQueue()
I have not be able to find an example, though. I want to access this from a webapplication running from a war in the same container as the hornetQ, so I'm not sure tha the Micro Container is relevant in this case?
I looked up the bean name in hornetq-jboss-beans.xml and it is named "HornetQServer".
Thanks for any help!