0

We are migrating an application from JBoss 4.2.1 GA to JBos EAP 7.0.0. The application audits currentThreadsBusy that is thread count. This does not work on EAP.

Below is the code snippent

javax.management.MBeanServerConnection server = java.lang.management.ManagementFactory.getPlatformMBeanServer();
javax.management.QueryExp qe = javax.management.Query.finalSubString(javax.management.Query.attr("name"), javax.management.Query.value("-" + request.getLocalPort()));
System.out.println("qu = "+qe.toString());      
Set<ObjectInstance> set = server.queryMBeans(new javax.management.ObjectName("jboss.web:type=ThreadPool,*"),qe);
System.out.println("Set = "+set);
String objectName = "";
for (ObjectInstance objectInstance : set) {
     if (objectInstance.getObjectName().getCanonicalName().contains("=http")) {
         objectName = objectInstance.getObjectName().getCanonicalName();
     }
  }
System.out.println("objectName = "+objectName);
Object object = server.getAttribute(new ObjectName(objectName),"currentThreadsBusy");
System.out.println("object "+object);

The issue is the Set returned is NULL.

The issue could be we need to enable web thread monitoring on EAP 7 before we can query the mbean service.

In the jConsole too we cannot see the web thread component.

Any pointer or help is appreciated here.

Ameya
  • 1,914
  • 4
  • 29
  • 55
  • I don't believe the `jboss.web` name exists any longer. Have a look at https://docs.jboss.org/author/display/WFLY10/JMX+subsystem+configuration. – James R. Perkins May 18 '17 at 15:17
  • I do know that as I cannot find in jconsole. How to measure the http thread as done in 4.2.1.GA ? The link you pointed me contains reference to java thread that is not the HTTP thread. – Ameya May 19 '17 at 10:48

0 Answers0