Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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:
http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html

The JConsole executable can be found in the bin directory of the J2SE
installation directory.

To use JConsole to monitor ServiceMix:

Note: ServiceMix should be running first!

How to Use JConsole to Monitor ServiceMix

The following information will be needed: You need to know the ServiceMix port number and , the ServiceMix container id, and the JMX Service URL.
By default:

...

This information was specified in the previous section.

  1. ServiceMix should be running first. Please see the #Getting Started Guide for instructions on running ServiceMix.
  2. Run 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
    
  3. Click on the Advanced tab.
    Enter the following in the Form:
    Code Block
    
    
    JMX URL: service:jmx:rmi:///jndi/rmi://localhost:1099/defaultJBIJMX

...

Testing JConsole with ServiceMix

To see JConsole in action, start one of the ServiceMix examples running, for instance, the
Basic Example:

...

  1. 
    
    
    
    h3. Testing JConsole with ServiceMix
    To see JConsole in action, start one of the ServiceMix examples running, for instance, the
    Basic Example:
    
    
    cd
  1. servicemix_install_dir

...

  1. \examples\basic

...


  1. ..\..\bin\servicemix

...

  1. servicemix.xml
    Code Block
    
    
    

...

  1. Then run JConsole and

...

  1.  
     
    To enable JMX remoting with Java 5 on some platforms the JAVA_OPTS environment variable needs to be set first. There's no need to set this on OS X or Windows:

...

  1. 
    
    

...

  1. export

...

  1. JAVA_OPTS="-Dcom.sun.management.jmxremote.port=5001

...

  1. -Dcom.sun.management.jmxremote.authenticate=false

...

  1. -Dcom.sun.management.jmxremote.ssl=false"
    Code Block
    
    
    

...

  1. Then run JConsole
    
    
    jconsole
    Code Block
    
    

...

  1. 
    

...

  1. Go to the advanced tab and enter the JMX Service

...

Image Removed

then you should see all of the ServiceMix MBeans in the console.

Image Removed

Using MC4J

When you want to get at the ServiceMix MBeans using MC4J use JSR160 as your server connection type and the above default JMX Service URL as your server URL.

Panel
borderColor#ccc
titleMC4J - JMX Console
borderStylesolid

Image Removed

Panel
borderColor#ccc
titleMC4J - JMX Console view 2
borderStylesolid

Image Removed

ServiceMix JMX Console

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

To create the ServiceMix WAR from a fresh checkout of the code try this

...

  1.  URL
    
    !JConsole-connect.png|thumbnail!
    
    then you should see all of the ServiceMix MBeans in the console.
    
    !JConsole.png|thumbnail!
    
    h3. Using MC4J
    
    When you want to get at the ServiceMix MBeans using MC4J use *JSR160* as your server connection type and the above default JMX Service URL as your server URL.
    
    {panel:title= MC4J - JMX Console|borderStyle=solid|borderColor=#ccc}
    
    !http://servicemix.org/jmx2.jpg!
    {panel}
    
    {panel:title= MC4J - JMX Console view 2|borderStyle=solid|borderColor=#ccc}
    
    !http://servicemix.org/servicemix-mc4j.png!
    {panel}
    
    h3. ServiceMix JMX Console
    
    ServiceMix comes with a WAR which can be deployed, including ServiceMix inside any Servlet / J2EE application server in a standard deployment unit. The added benefit of the ServiceMix WAR is it includes a simple JMX operational console as well allowing your web browser to view JMX attributes and statistics.
    
    To create the ServiceMix WAR from a fresh checkout of the code try this
    
    
    cd

...

  1. servicemix/tooling/servicemix-web

...


  1. maven

...

  1. war

...

  1. Code Block

Then drop the WAR in any servlet engine.