Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Using a JMX Console

...

with ServiceMix

This document explains how to connect a JMX Console to ServiceMix. The following three open source JMX Consoles will be discussed:

...

The ServiceMix JBIContainer exposes internal services and Components through JMX. The JBIContainer can be passed as a JMXBeanServer or, it can be configured to create one , if one doesn't exist (see Configuration). If the JBIContainer creates its own MBeanServer instance, it also creates an RMI JMXConnector - to allow remote connections. The Ant Tasks use thisthe following:

Code Block
titleCreating remote JMX Connector to the JBIContainer
String jndiPath = <container name> + "JMX";
JMXServiceURL url = new JMXServiceURL ("service:jmx:rmi:///jndi/rmi://<namingHost>:<namingPort>/" + jndiPath) ;
JMXConnector connector = JMXConnectorFactory.connect(url);


The following configuration variables will be needed in are required for the next sections.

NOTE: The values shown are the default settings for ServiceMix.

Anchor
settings
settings

...

The Java-2 Platform, Standard Edition (J2SE) 5.0 release includes a JMX monitoring tool, JConsole. JConsole monitors applications running on the Java platform and provides information on their performance and resource consumption. Please see Sun's documentation for more information on using this tool. Please see the following sections for instructions on configuring and using JConsole with ServiceMix.

NOTE: this This tool is available with the Java 5 release only.

...

This section explains how to configure JConsole to monitor ServiceMix. The ServiceMix port number, the ServiceMix container id, and the JMX Service URL will be required. This information was specified in the previous section, in the Default Settings box.

  1. ServiceMix should be running first. Please see the #Getting Getting Started Guide guide for instructions on running ServiceMix.
  2. Start JConsole from a command shell. The JConsole executable can be found in the bin directory of the J2SE installation directory.
    Code Block
    cd [J2SE_install_dir]\bin
    jconsole
    
    The JConsole window will appear.

  3. Click on the "Advanced" tab. The following URL must be entered in the "JMX URL" box: service:jmx:rmi:///jndi/rmi://hostname:port/app_to_monitor. Where the hostname is name of the host on which the application to be monitored is running, the port is the port number to connect to the application, and the app_to_monitor is the JMX enabled application to monitor. For example, if none of the defaults for ServiceMix have been modified and ServiceMix is running on localhost, enter the following: service:jmx:rmi:///jndi/rmi://localhost:1099/defaultJBIJMX.

    Panel
    borderColor#ccc
    titleJConsole Agent
    borderStylesolid

  4. Click the Connect box to connect to the ServiceMix container. org.servicemix will be visible in the console. Click on org.servicemix to see its MBeans.

    Panel
    borderColor#ccc
    titleJConsole Management & Monitoring
    borderStylesolid


...

  1. ServiceMix should be running first. Please see the #Getting Getting Started Guide guide for instructions on running ServiceMix.
  2. Click on the MC4J executable MC4J Console 1.2b9.exe (for Windows) to start MC4J. The executable can be found in the top-level directory of the MC4J installation. The MC4J window will appear.
  3. Select "Management>Create Server Connection..." from the menu. This will start "My Wizard". The connection to ServiceMix can be created using the wizard.

    Panel
    borderColor#ccc
    titleMC4J My Wizard
    borderStylesolid



  4. Enter the following into the text boxes/pull-down menus:
    Select your server connection type: JSR160
    Name: This can any name, for example, ServiceMix
    Server URL: service:jmx:rmi:///jndi/rmi://localhost:1099/defaultJBIJMX
    The Server URL is service:jmx:rmi:///jndi/rmi://hostname:port/app_to_monitor. Where the hostname is name of the host on which the application to be monitored is running, the port is the port number to connect to the application, and the app_to_monitor is the JMX-enabled application to monitor. For example, if none of the defaults for ServiceMix have been modified and ServiceMix is running on localhost, enter the following: service:jmx:rmi:///jndi/rmi://localhost:1099/defaultJBIJMX.
  5. Accept the defaults for the rest of the fields in the Wizard.
  6. Click "Next."
  7. Click "Finish" in the next window.
    A connection to ServiceMix has been added to MC4J!

    Panel
    borderColor#ccc
    titleMC4J Connections
    borderStylesolid


...

ServiceMix JMX Console

ServiceMix comes with a WAR which can be deployed, including ServiceMix includes a simple JMX operational console. A ServiceMix WAR file can be created and deployed inside any Servlet / J2EE application server in a standard deployment unit. The added benefit of the ServiceMix WAR file is that it includes a simple JMX operational console, as well allowing your web browser JMX Console that allows a web browser to be used to view JMX attributes and statistics.

Starting the ServiceMix JMX Console

To create the ServiceMix WAR file from a fresh checkout of the code try the followingsource download of ServiceMix do the following:

  1. Download and build the ServiceMix source code. Please see the Getting Started guide for instructions.
  2. Create the WAR file:
    Code Block
    
    cd 

...

  1. [servicemix_install_dir]\tooling\servicemix-web
    maven war
    
    where servicemix_install_dir is the directory to which ServiceMix was downloaded.
  2. Deploy the WAR file into any servlet engine. Instructions for deploying ServiceMix on Tomcat, JBoss, and Geronimo can be found at the following links:
    • Tomcat - this documentation is currently under development. Please click 'Watch' to be notified of updates to this Space's content, automatically.
    • JBoss
    • Geronimo
  3. Run the ServiceMix JMX Console. To do this enter the following URL in a web browser: http://localhost:8080/servicemix-web

Using the ServiceMix JMX Console

For examples of how to use the ServiceMix JMX Console, please see War DeploymentThen drop the WAR in any servlet engine.

Related Documentation