Reputation: 23
I was reading about how to get some stats in java using JMX and I can see that mostly of the solutions that are proposed on the internet uses a client to get them remotelly.
I would like to know if it would be posible to get them programatically inside my code without open a conection (not even to localhost).
I am interested in reading the current the lag for a kafka group, that uses reactor kafka to create the consumers.
thx
Upvotes: 1
Views: 190
Reputation: 174494
Get a reference to the MBeanServer then you can run a query with the ObjectName.
Upvotes: 1