Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Need help in integrating JMX

 
Ranch Hand
Posts: 48
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am developing a monitoring tool for our webhosted application. I have a skeleton structure of the application and one service to monitor HTTP status is implemented. I need to know about integrating JMX with my application.

Googling only gave results to integrate with jconsole. I need to know if we can represent the JMX data in our own application. Also can any one provide with any examples to obtain data.

I am having problems is starting up with this. Please help. Also didn’t find corrrect forum to post this. so posted in this java general forum.
 
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See https://coderanch.com/how-to/java/JmxExample for just about the simplest possible example of how to JMX-enable an application.

Yes, you can do that from within your app - JMX has a remote API. Check out this article, particularly the "Connect to the JMX agent programmatically" section.
 
Manju Krishna
Ranch Hand
Posts: 48
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I also wanted to know if there is a way to obtain the runtime JVM details of an application without using jConsole.
In my tool I do not want another UI like Jconsole to display data. I need those data and I would format a report as I need
 
Ulf Dittmer
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's what the second part of my answer is all about; did you read the article yet?
 
Manju Krishna
Ranch Hand
Posts: 48
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I read through the article now. Jconsole has tabs to display Mbean data and there are other tabs to view VM statistics. Like threads used, CPU usage, classes loaded etc.. How can I get those information ?
The MC4J client just reads the Mbean properties and gives that, which is again a third party tool.
I wanted to know if I can leverage the JMX output to my simple Java application to display JVM details. Hope I conveyed it right
Please help.

 
Ulf Dittmer
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you notice that I specifically mentioned the "Connect to the JMX agent programmatically" section, which is not at all about MC4j but all about the Java API?
 
Are we home yet? Wait, did we forget the tiny ad?
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic