i am trying to count total number of messages on the honretQ using the core management api
i configured a management queue named jms.queue.hornetq.management in the honret configurations and then i tried with the following code after my producer sends my message onto the queue
ClientSession managedsession = MyCoreSession.getSession();
ClientRequestor requestor = new ClientRequestor(managedsession, "jms.queue.hornetq.management");
ClientMessage messagemanaged = managedsession.
ClientMessage reply = requestor.request(messagemanaged,1000);
int count = (Integer) ManagementHelper.getResult(reply);
System.out.println("There are " + count + " messages in exampleQueue");
Error obtained is :-
creating session at Mon Dec 02 08:50:59 GMT 2013
message sent successfully
Received TextMessage:1;02/20/2012 14:01:59.010;1020,1021,1022
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
Message count has to be a integer and i dont know what reply i am getting clearly not getting it
Can somebody please help me on this?
what version are you using, I think this was fixed a long time ago