[infinispan-issues] [JBoss JIRA] Created: (ISPN-1109) Expose JGroups JChannel JMX monitoring

Mathieu Lachance (JIRA) jira-events at lists.jboss.org
Sat May 14 09:39:00 EDT 2011


Expose JGroups JChannel JMX monitoring
--------------------------------------

                 Key: ISPN-1109
                 URL: https://issues.jboss.org/browse/ISPN-1109
             Project: Infinispan
          Issue Type: Feature Request
          Components: JMX, reporting and management
    Affects Versions: 5.0.0.CR2
            Reporter: Mathieu Lachance
            Assignee: Manik Surtani
            Priority: Trivial
             Fix For: 5.0.0.CR3


To use JGroups JChannel JMX monitoring, it's needed to register it to a MBeanServer.
Would it be possible to add a configuration key to be able to monitor the cache at a network level ?
Here's the actual JGroups documentation to activate JMX monitoring programmatically : http://community.jboss.org/wiki/JMX

I guess the correct place to implements the feature should be located in org.infinispan.remoting.transport.jgroups.JGroupsTransport::startJGroupsChannelIfNeeded()
and implementation could look like that :

protected void startJGroupsChannelIfNeeded() {
        if (startChannel) {
            try {
                channel.connect(configuration.getClusterName());
                // my first contribution M Lachance
                ArrayList servers = MBeanServerFactory.findMBeanServer(null);
 
                if (servers == null || servers.size() == 0) {
                    log.log(Logger.Level.WARN, "No Available MBean Servers");
                    //throw new Exception("No MBeanServers found;" +
                    //        "\nJmxTest needs to be run with an MBeanServer present, or inside JDK 5");
                } else {
 
                    MBeanServer server = (MBeanServer) servers.get(0);
                    try {
                        if (server != null) {
                            JmxConfigurator.registerChannel((JChannel) channel, server, "JChannel=" + channel.getChannelName(), "", true);
                        }
                    } catch (Exception e) {
 
                        log.log(Logger.Level.WARN, "Could not resgister with JMX",e);
                    }
                }
            } catch (ChannelException e) {
                throw new CacheException("Unable to start JGroups Channel", e);
            }
        }
        address = new JGroupsAddress(channel.getAddress());
        if (log.isInfoEnabled())
            log.localAndPhysicalAddress(getAddress(), getPhysicalAddresses());
    }

Thanks,


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the infinispan-issues mailing list