[
https://issues.jboss.org/browse/ISPN-1109?page=com.atlassian.jira.plugin....
]
Galder Zamarreño updated ISPN-1109:
-----------------------------------
Description:
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 :
{code}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());
}{code}
Thanks,
was:
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,
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: Galder Zamarreño
Priority: Trivial
Labels: jgroups, jmx
Fix For: 5.0.0.CR4, 5.0.0.FINAL
Original Estimate: 3 hours
Remaining Estimate: 3 hours
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 :
{code}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());
}{code}
Thanks,
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira