有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java JMX数据作为JSON

我想使用JMX监控SpringBean,但是让它处理复合数据是相当痛苦的。所以我决定将返回的值映射到JSON文本字符串。但这是一个共同的解决方案吗?这在概念上正确吗?什么会出错


共 (1) 个答案

  1. # 1 楼答案

    您可以使用Jolokia

    Jolokia is an agent based approach for remote JMX access. It is an alternative to standard JSR 160 connectors. The communication between client and agent goes over HTTP (either GET or POST), where the request and response payload is represented in JSON.

    有关将JMX实现为JSON的java代码,请参见jmxtrans

    This is effectively the missing connector between speaking to a JVM via JMX on one end and whatever logging / monitoring / graphing package that you can dream up on the other end.

    jmxtrans is very powerful tool which uses easily generated JSON (or YAML) based configuration files and then outputs the data in whatever format you desire.