This content has been marked as final.
Show 1 reply
-
1. Re: Invoke stopdelivery on consumer of a queue
ayushgupta Apr 2, 2012 5:15 AM (in response to ayushgupta)Yeah I found the answer.
Context cntx = new InitialContext();
rmiAdaptor = (RMIAdaptor) cntx.lookup("jmx/invoker/RMIAdaptor");
String consumer = "jboss.j2ee:*,name=MyConsumer,service=EJB3";
Set<ObjectName> queueMbeanObjects = rmiAdaptor.queryNames(new ObjectName(consumer ), null);
for (ObjectName object : queueMbeanObjects){
rmiAdaptor.invoke(object, "stopDelivery", null, null);
}