Java Management Extensions (JMX) is a powerful Java technology that supplies tools for managing and monitoring Java applications. In this blog, I will explain how to enable JMX monitoring in IBM Sterling B2B Integrator and how to use Java VisualVM to monitor the application performance.
With VisualVM you can monitor the application memory consumption, the application threads and most importantly, profile the application performance and gather detailed data on method-level execution time and number of invocation.
Enable JMX monitoring in Sterling B2B Integrator:
- Stop the IBM Sterling B2B Integrator application server.
- Add JMX_PORT=anyfreeport e.g JMX_PORT=5555 to sandbox.cfg
- Run setupfiles.sh and start the application server.
The Jave arguments to enable JMX monitoring will be added to startNoAppNode.sh and startNoApp.sh used to start the application server.
Extract from the starting scripts:
startNoAppNode.sh:
JAVA_SERVER_ASI="${JAVA_SERVER_ASI}
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=5555
-Dcom.sun.management.jmxremote.authenticate=false"
startNoApp.sh:
JAVA_SERVER_ASI="${JAVA_SERVER_ASI}
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.port=5555
-Dcom.sun.management.jmxremote.authenticate=false"
You can verify the arguments are added to the application server process argument with ps -ef | grep -i noapp
You can check the JMX port is active with netstat.
Monitor your application with VisualVM:
VisualVM comes with the Oracle Java JDK or can be downloaded separately here.
First, you need to configure your application hostname or IP and port in visualVM:
Once your connection is established, you will be able to monitor your JVM memory and threads, trigger garbage collection and take thread dumps. By default the profiling tool will not be running until you are ready to profile the application.
When you are ready to profile, for example start your load testing or investigate an application slowness, you need to go to the sampler tab to start the CPU profiling:
Each system or implementation is different, I recommend to always keep a baseline profiling snapshot to compare with later. The profile is very intuitive so you will figure this out very quickly.
I share some profiler outputs from Sterling B2B Integrator to look at so you can have an idea about different scenarios or performance situations. I also share some comments and interpretation:
JMX monitoring is a very powerful tool that helps a lot in uncovering non obvious and hidden bottlenecks, benchmarking, comparing implementation and also improving performance throughput. When the logs, thread dumps, OS tools, DB tools cannot help you detect where your application time is spent over time, think about using JMX profiling.
Sumanth
Hi,
Is there an open source tool to view and monitor B2B Integrator errors, description (map name, error detail) and fetch the file for the same.
Lindsay McCurdy
It is strongly recommended to secure the JMX console by implementing user authentication and to check the JDK version in order to mitigate threats
https://mogwailabs.de/en/blog/2019/04/attacking-rmi-based-jmx-services/
https://www.ibm.com/support/pages/apar/IV84027