Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-8378

[7.1] Documentation - Migration - provide information how to migrate from HornetQ/Artemis JMX management to EAP JMX management

XMLWordPrintable

      HornetQ/Artemis provides JMX management which is unsupported. If any of the customer was relying on this feature in EAP 5/6 (HornetQ) then he should migrate his management tooling to use either CLI or EAP 7 JMX management.

      Note that EAP 7 JMX management provides equivalent functionality but names of methods and their parameters were changed and does not have to match. To find equivalent methods you can connect using EAP_HOME/bin/jconsole.sh, connect to server and in MBeans tab click on "jboss.as" -> "messaging-activemq" -> "default" -> "Operations". You will find method name and attributes there.

      Here is example of code change from EAP 6 HornetQ JMX management to EAP 7 JMX management:

       JMXConnector connector = null;
              try {
      
                  HashMap environment = new HashMap();
                  String[] credentials = new String[]{"admin", "Password123!"};
                  environment.put(JMXConnector.CREDENTIALS, credentials);
      //          JMX protocol was changed between EAP 6 and EAP 7 remoting-jmx -> remote+http, there is also change in port number
      //            JMXServiceURL beanServerUrl = new JMXServiceURL("service:jmx:remoting-jmx://127.0.0.1:9999");
                  JMXServiceURL beanServerUrl = new JMXServiceURL("service:jmx:remote+http://127.0.0.1:9990");
      
                  connector = JMXConnectorFactory.connect(beanServerUrl, environment);
                  MBeanServerConnection mbeanServer = connector.getMBeanServerConnection();
      //            Old object name pointing to HornetQ JMX management
      //            ObjectName objectName = new ObjectName("org.hornetq:type=Server,module=JMS");
      //            New JMX object name poiting to EAP 7 JMX management to messaging-activemq subsystem
                  ObjectName objectName = new ObjectName("jboss.as:subsystem=messaging-activemq,server=default");
      
      //            Name of the method was changed from listConnectionIDs -> listConnectionIds
      //            String[] connections = (String[]) mbeanServer.invoke(objectName, "listConnectionIDs", new Object[]{}, new String[]{});
                  String[] connections = (String[]) mbeanServer.invoke(objectName, "listConnectionIds", new Object[]{}, new String[]{});
                  for (String connection : connections) {
                      System.out.println(connection);
                  }
              } finally {
                  if (connector != null) {
                      connector.close();
                  }
              }
      

      Client libraries needs to upgrade to jboss-client.jar from in EAP 7.

              sgilda_jira Sande Gilda (Inactive)
              mnovak1@redhat.com Miroslav Novak
              Miroslav Novak Miroslav Novak
              Miroslav Novak Miroslav Novak
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: