Delete all messages in queue Websphere 8.5 SIB via JMX <p>I want to delete all the messages in a queue configured in Websphere 8.5 SIB. Below are two approaches I tried, but none of them seem to be working and each throws a different exception. Can someone please advise on what is the correct way to achieve this.</p> <p><strong>Approach 1</strong></p> <pre><code>MBeanServerConnection connection = getServerConnection(); connection.invoke(new ObjectName("WebSphere:*,type=SIBQueuePoint,name=jms.queue.MY_QUEUE"), "deleteAllQueuedMessages", null, null); </code></pre> <p>This approach throws the below exception.</p> <blockquote> <p>javax.management.InstanceNotFoundException: WebSphere:type=SIBQueuePoint,name=jms.queue.MY_QUEUE</p> </blockquote> <p><strong>Approach 2</strong></p> <pre><code>MBeanServerConnection connection = getServerConnection(); ObjectName objQueue = new ObjectName(WAS85_RESOURCE_URL + ",type=SIBQueuePoint"); Set&lt;ObjectName&gt; objNames = connection.queryNames(objQueue, null); for(ObjectName objName: objNames) { String qName = connection.getAttribute(objName,"identifier").toString(); if(qName.equals("jms.queue.MY_QUEUE")) { connection.invoke(objName, "deleteAllQueuedMessages", null, null); } } </code></pre> <p>This approach throws the below exception.</p> <blockquote> <p>javax.management.ReflectionException: Target method not found: com.ibm.ws.sib.admin.impl.JsQueuePoint.deleteAllQueuedMessages</p> </blockquote>