Java Activemq topic jmx browse messages -


the following question activemq 5.13.

i have 2 durable subscribers listening topic, lets exampletopic. need delete messages on topic when particular event occurs. tried find jolokia apis same couldn't find any. i've decided use jmx mbeans browse messages , delete them 1 one.

a simple java program connect jmxservice , fetch information messages.

jmxserviceurl url = new jmxserviceurl("service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi"); jmxconnector jmxc = jmxconnectorfactory.connect(url); mbeanserverconnection conn = jmxc.getmbeanserverconnection(); objectname mbeanname = new objectname("org.apache.activemq:type=broker,brokername=localhost"); topicviewmbean bean = mbeanserverinvocationhandler.newproxyinstance(conn, mbeanname, topicviewmbean.class, true); list list = bean.browsemessages(); 

however throws following exception:

java.lang.reflect.undeclaredthrowableexception         @ com.sun.proxy.$proxy0.browsemessages(unknown source)         @ com.exportstaging.main.test.main(test.java:25)         @ sun.reflect.nativemethodaccessorimpl.invoke0(native method)         @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62)         @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43)         @ java.lang.reflect.method.invoke(method.java:498)         @ com.intellij.rt.execution.application.appmain.main(appmain.java:147) caused by: javax.management.reflectionexception: no such operation: browsemessages 

i tried find web this, couldn't find solution.

can me fix this.

thanks in advance


Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -