Core Management Error
shlamalama Feb 27, 2014 10:07 PMI'm trying to invoke the "removeMessages" call on a queue. I'm using 2.4.0.Final, running embedded (no container), using only the core api.
Here's my code:
ClientSession clientSession = _clientSessionFactory.createSession(true, true, 0);
ClientRequestor requestor = new ClientRequestor(clientSession, "jms.queue.hornetq.management");
ClientMessage message = clientSession.createMessage(false);
ManagementHelper.putOperationInvocation(message, "core.queue.queue.exampleQueue", "removeMessages", null);
ClientMessage respMsg = requestor.request(message);
String reply = (String) ManagementHelper.getResult(respMsg);
log.info("got reply: " + reply);
return reply;
I get this error saying the operation does not exist. Any clue what I could be doing wrong? I have a queue named "queue.exampleQueue", and I am sending messages to it successfully. I've tried using both "null" and empty string as arguments, per the User Guide, both give this error:
WARN: HQ222111: exception while invoking removeMessages on core.queue.queue.exampleQueue
java.lang.IllegalArgumentException: HQ119069: no operation removeMessages/0
at org.hornetq.core.server.management.impl.ManagementServiceImpl.invokeOperation(ManagementServiceImpl.java:840)
at org.hornetq.core.server.management.impl.ManagementServiceImpl.handleMessage(ManagementServiceImpl.java:418)
at org.hornetq.core.server.impl.ServerSessionImpl.handleManagementMessage(ServerSessionImpl.java:1607)
at org.hornetq.core.server.impl.ServerSessionImpl.send(ServerSessionImpl.java:1363)
at org.hornetq.core.protocol.core.ServerSessionPacketHandler.handlePacket(ServerSessionPacketHandler.java:471)
at org.hornetq.core.protocol.core.impl.ChannelImpl.handlePacket(ChannelImpl.java:633)
at org.hornetq.core.protocol.core.impl.RemotingConnectionImpl.doBufferReceived(RemotingConnectionImpl.java:547)
at org.hornetq.core.protocol.core.impl.RemotingConnectionImpl.bufferReceived(RemotingConnectionImpl.java:523)
at org.hornetq.core.remoting.server.impl.RemotingServiceImpl$DelegatingBufferHandler.bufferReceived(RemotingServiceImpl.java:635)
at org.hornetq.core.remoting.impl.invm.InVMConnection$1.run(InVMConnection.java:160)
at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:107)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)