3 Replies Latest reply on Jul 1, 2009 8:43 AM by ips

    Integration of JBoss Messaging 2.0 in Embedded JOPR

    jmesnil

      I'm currently integrating JBoss Messaging 2.0.0 in AS 5 and I want to manage it using the embedded JOPR.

      JBM 2 exposes all its management API through JMX MBeans registered in the AS 5 MBeanServer, so we can already use the jmx-console to manage it.

      I also want to expose it in the admin console but so far, no success.

      JBM 2 is located in deploy/messaging.sar directory.
      Based on http://management-platform.blogspot.com/2008/11/monitoring-custom-jmx-mbeans-with-jopr.html, I added a META-INF/rhq-plugin.xml in the SAR directory but it is not picked by JOPR:

      <?xml version="1.0" encoding="UTF-8" ?>
      
      <plugin name="JBossMessaging"
       version="1.0"
       displayName="Custom JMX Plugin"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns="urn:xmlns:rhq-plugin"
       xmlns:c="urn:xmlns:rhq-configuration">
      
       <depends plugin="JMX" />
       <depends plugin="JBossAS" />
      
       <service name="Messaging Service"
       description="JBoss Messaging Service"
       discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent"
       class="org.rhq.plugins.jmx.MBeanResourceComponent">
      
       <runs-inside>
       <parent-resource-type name="JMX Server" plugin="JMX"/>
       <parent-resource-type name="JBossAS Server" plugin="JBossAS"/>
       </runs-inside>
      
       <plugin-configuration>
       <c:simple-property name="objectName"
       default="org.jboss.messaging:module=Core,type=Server"
       readOnly="true"/>
       </plugin-configuration>
       </service>
      
      </plugin>
      


      I looked at JOPR/Embedded JOPR doc but I couldn't find a solution:

      * have I put rhq-plugin.xml at the right place?
      * does it work with SAR (and exploded archive)?

      I've also more general questions about exposing MBeans to JOPR.
      JBM 2 provides a lot of MBeans with full MBeanInfo (description of attributes, operations, etc.)

      * should I repeat this info in rhq-plugin.xml or is there a way to tell JOPR to expose everything exposed by the MBean?
      * the ObjectNames defines a hierarchy using attributes. Does JOPR know how to create a hierarchy from ObjectName attributes (a la jconsole) or should I redefine explicitly the hierarchy in rhq-plugin.xml?

      (fwiw, JBM does not use Maven)

      thanks

        • 1. Re: Integration of JBoss Messaging 2.0 in Embedded JOPR
          mazz

          The plugin jar is just that, a jar (not sar).

          rhq-plugin.xml must be located in META-INF within your jar.

          You deploy the plugin by using the Jopr UI - Administration>SystemConfiguration>Plugins (there is a way to file upload it from there - once you file upload it, you can "scan for new plugins" or wait a few minutes for the server to detect it. Or you can manually copy it to <jopr-server-install-dir>/jbossas/server/default/deploy/rhq.ear/rhq-downloads/rhq-plugins and wait for the server to detect it (typical default is 5 min wait time unless you built the server using the -Pdev profile in which case the default is 30 seconds).

          Now you start up your agent and your agent will automatically pull down the new plugin and start to use it.

          should I repeat this info in rhq-plugin.xml or is there a way to tell JOPR to expose everything exposed by the MBean?


          Jopr does not support dynamic metadata yet - its on the plan, for more info, see our design doc on this: http://jopr.org/confluence/display/RHQ/Dynamic+Metadata

          the ObjectNames defines a hierarchy using attributes. Does JOPR know how to create a hierarchy from ObjectName attributes (a la jconsole) or should I redefine explicitly the hierarchy in rhq-plugin.xml?


          That would, again, be a feature our our dynamic metadata model - as explained above, not yet supported. So yes you model this today in your rhq-plugin.xml plugin descriptor.

          John

          • 2. Re: Integration of JBoss Messaging 2.0 in Embedded JOPR
            jmesnil

             

            "mazz" wrote:
            The plugin jar is just that, a jar (not sar).

            rhq-plugin.xml must be located in META-INF within your jar.

            You deploy the plugin by using the Jopr UI - Administration>SystemConfiguration>Plugins (there is a way to file upload it from there - once you file upload it, you can "scan for new plugins" or wait a few minutes for the server to detect it. Or you can manually copy it to <jopr-server-install-dir>/jbossas/server/default/deploy/rhq.ear/rhq-downloads/rhq-plugins and wait for the server to detect it


            I'm confused: I use a regular JBoss 5.1.0.GA - which comes with Administration Console 1.2.0.GA (r457) - and the admin console UI does not have a "Administration" menu/button/tab.
            And there is no rhq.ear/ in the deploy directory neither.

            JBoss Messaging 2.0 management API has significantely changed and I want to replace the current "Resource > JMS Destinations" resources (+ provide management of the messaging service itself).
            Where is the plugin which defines the current JBoss Messaging 1.x resources in embedded jopr?

            "mazz" wrote:

            Jopr does not support dynamic metadata yet - its on the plan, for more info, see our design doc on this: http://jopr.org/confluence/display/RHQ/Dynamic+Metadata


            OK, I'll fill the plugin configuration with the MBean infos.

            thanks


            • 3. Re: Integration of JBoss Messaging 2.0 in Embedded JOPR
              ips

               

              I'm confused: I use a regular JBoss 5.1.0.GA - which comes with Administration Console 1.2.0.GA (r457) - and the admin console UI does not have a "Administration" menu/button/tab.
              And there is no rhq.ear/ in the deploy directory neither.


              I think Mazz got mixed up what forum this post is on, and was thinking you were using Jopr, rather than Embedded Jopr.

              JBoss Messaging 2.0 management API has significantely changed and I want to replace the current "Resource > JMS Destinations" resources (+ provide management of the messaging service itself).
              Where is the plugin which defines the current JBoss Messaging 1.x resources in embedded jopr?


              We have support for JBoss Messaging 1.x in both the jboss-as (JBAS 4.x) and jboss-as-5 (JBAS 5.x) plugins. The former discovers topics and queues that are deployed to an AS 4.x server and uses JMX to do so. The latter discovers topics and queues that are deployed to an AS 5.x server and uses the Profile Service to do so.

              Since JBoss Messaging 2.0 could be deployed to AS 4.x, AS 5.x, or any other JEE or J2SE server, I think it makes the most sense to write a standalone plugin for managing it (e.g. a jboss-messaging-2 plugin). That plugin would be easy to write, since it could leverage the jmx plugin. A good example of a similar plugin is the hibernate plugin; I would definitely take a look at its source code:

              http://anonsvn.jboss.org/repos/jopr/trunk/modules/plugins/hibernate/

              Hopefully the jboss-messaging-2 plugin is something you'll contribute back to the Jopr community!

              Regards,
              Ian