Hello,
I tried some posibilities to destroy a Topic with removing of its subscribers, but I did not find the right invocation. It should be a function, which takes also a boolean to control the removing the subsribers.
Here is my code with some variants:
....
mBeanServer = (MBeanServer) javax.management.MBeanServerFactory
.findMBeanServer(null).iterator().next();
try {
on = ObjectNameBuilder.DEFAULT.getJMSServerObjectName();
mBeanServer.invoke(on, "destroyTopic" , new Object[] { topicName, true }, new String[] {"java.lang.String" });
v.2//mBeanServer.invoke(on, "destroyTopic" , new Object[] { topicName, true }, new String[] {"java.lang.String" , boolean.class.getName()}); ERROR: javax.management.ReflectionException: Signature mismatch for operation destroyTopic: (java.lang.String, java.lang.Boolean) should be (java.lang.String)
v.3//mBeanServer.invoke(on, "destroyTopic" , new Object[] { topicName, true }, new String[] {"java.lang.String" ,"java.lang.Boolean"}); ERROR: smth, like too many parameters
} catch (Exception e) {
e.printStackTrace();
}
...
no one works. Can somebody help me please?
This is a duplicate. See https://community.jboss.org/thread/239971 for the original discussion (which includes an answer to this specific question).