Accessing JMX Data

If you want to access JMX data you can use standard Java tools like JConsole. It may be enough for accessing single node and getting data only from Main Server. But when you want to get data also from all running microservices...finding their PID and jmx port could be inconvenient. That's why JLupin create tools for easy access to all of this data. You event integrate it with your monitoring system! The tool is called JMX Extractor and is exposed in few different ways: as a microservice, as a library and as command line tool (CLI).

This configuration is the best and easiest option to get data from all nodes and microservices. The main concept is shown below.

Figure 1. Accessing JMX data.

JMX Extractor microservice is configured to get list of nodes from JLupin Platform Control Center. Then it retrieves data from all Main Servers and gets JMX ports for every microservice to ask them for data too. JLupin Extractor microservice is running on JPCC by default and has configured connection to it (with special user jmx-extractor). Asking JMX Extractor microservice can be done through all standard JLupin Entrypoints but there two best for this job: JLRMC and HTTP Elastic API. It means getting directly from Java code or through HTTP request (ideal for other systems).

Microservice outside JPCC

This configuration is different from the previous one with JMX Extractor microservice. The main concept is shown below.

Figure 2. Accessing JMX data.

JMX Extractor microservice can be configured to access JLupin Platform Control Center (even that it is not running on same machine) or can have list with static IP addresses of machines with JLupin Platform. It depends on how it is configured - what provider is used: jpcc or list. Provider jpcc works exactly the same as described in previous configuration. The only difference is a location of JMX extractor microservice. With list provider you put in configuration static list of IP addresses. Asking JMX Extractor microservice can be done through all standard JLupin Entrypoints but there two best for this job: JLRMC and HTTP Elastic API. It means getting directly from Java code or through HTTP request (ideal for other systems).

Command line tool (CLI)

This configuration gives and option to get JMX data from command line. This way it can be easily integrated with other tools or for example with bash scripts. The main concept is shown below.

Figure 3. Accessing JMX data.

JMX Extractor CLI is accessing specified node and gets JMX data from it - all or the one configured in configuration file. Execution is done from command line like any other CLI program. To access many nodes you need to execute command many time with different IP address as argument.

Library

This configuration enables getting JMX data from inside Java code independently to any external microservice like in the option with JMX Extractor microservice. The main concept is shown below.

Figure 3. Accessing JMX data.

It is connecting by itself to specified node and gets data similar to all configurations - you can get all or selected data. To access many nodes you need to execute library call multiple times with different IP addresses.