SlideShare a Scribd company logo
Jolokia - JMX on Capsaicin
Roland Huß

Chili-Head
ConSol* Software GmbH
Me and the Chili

• Development and Operations @ ConSol
 –   Large Java Projects
 –   Remote Operations
 –   Open Source Monitoring (Nagios)
 –   www.consol.com
• Open Source Author
 – roland@cpan.org
 – https://github.com/rhuss
• Chili grower since 2005
                                        2
JMX
      JSR-3
   JSR-160
The Problem
JMX Refresher

• Java Management Extensions (JMX)
• JSR-3 (2000)
• Available out of the box since JDK 1.5
• JMX-Operations:
 – Attribute reading
 – Attribute writing
 – Execution of operations
 – Notifications


                                           4
JMX Architecture




                   5
JMX Remote API

• JSR-160 (2003)
• Problems:

    – Firewalls
    – Security is typically „all-or-nothing“
    – Strongly typed
    – Java only


                                               6
Jolokia
   Overview
   Features
     Clients
      Tools
How it works




               8
Agents


         JEE
         OSGi
         Mule
         JVM
                9
Tested on ...
Tomcat         5.5, 6.0, 7.0      Felix              2.0, 3.2, 4.0
                                                       3.5, 3.6,
Jetty        5.1, 6.1, 7.5, 8.0   Equinox            3.7, 3.8 M1
              9.2.3, 10.0.2,
Weblogic         10.3.5           Knopflerfish             3.2

Websphere      6.1, 7.0, 8.0      Virgo                2.1, 3.0

Glassfish       2.1, 3.0, 3.1      Spring dm Server       2.0

JBoss        4.2, 5.1, 6.1, 7.0   Mule               2.2, 3.1, 3.2

Jonas         4.10, 5.1, 5.2      ActiveMQ               5.5

Geronimo     2.1, 2.2, 3.0 M1     Terracotta             3.2

Camel               2.8           Hadoop                0.20         10
Quickstart




             11
Request

• HTTP GET
http://localhost/jolokia/read/java.lang:type=Memory/HeapMemoryUsage



• HTTP POST
             {
                 "type":"read",
                 "mbean":"java.lang:type=Memory",
                 "attribute":"HeapMemoryUsage"
             }



                                                                      12
Response

{
        "value": {
                     "init": 134217728,
                     "max": 532742144,
                     "committed": 133365760,
                     "used": 19046472
                 },
        "status": 200,
        "timestamp": 1244839118,
        "request": {
                      "mbean": "java.lang:type=Memory",
                      "type": "read",
                      "attribute": "HeapMemoryUsage"
                    }
    }
                                                          13
Request Types


version   Version and server information

read      Reading of attributes

write     Writing of attributes

exec      Execution of operations

search    Pattern search for MBeans

list      MBean meta data


                                           14
Bulk Requests

 [
     {
          "type" : "read",
          "mbean" : "java.lang:type=Memory",
          "attribute" : "HeapMemoryUsage",
          "path" : "used",
     },
     {
          "type" : "search",
          "mbean" : "*:type=Memory,*"
     }
 ]

                                               15
JSR-160 Proxy




                16
Proxy Request


{
    "attribute" : "HeapMemoryUsage",
    "mbean" : "java.lang:type=Memory",
    "target": {
       "url" : "service:jmx:iiop://websphere:2810/jndi/JMXConnector"
       "user" : "roland",
       "password" : "s!cr!t"
    },
    "type" : "READ"
}




                                                                   17
Security

• JSR-160 Security
 – Java Security and JAAS
• Jolokia Security
 – HTTP Security
 – Access Control with Policy Files
   • Network location
   • Command types
   • MBean, attribute and operation names



                                            18
Clients

Perl         Jmx4Perl
Javascript   Jolokia
Java         Jolokia
Python       Jmx4Py           Jürgen Herrmann
Node.js      jolokia-client   Joachim Kainz


Groovy
Scala                     You ?
.....
                                                19
Javascript Demo




                  20
Javascript
var j4p = new Jolokia("/jolokia");
var data = [];

function run() {
  j4p.request({
                 type: "read",
                 mbean: "java.lang:type=Memory",
                 attribute: "HeapMemoryUsage"
              },
              {
                 success: function(resp) {
                   data.push([resp.timestamp,resp.value.used]);
                   $.plot($("#memory"),[data],{ xaxis: { mode: "time" }});
                   setTimeout(run,1000);
                 }
              });
}
run();


                                                                             21
Tools


 jmx4perl         CLI Tool

 check_jmx4perl   Nagios Plugin

 cacti_jmx4perl   Cacti Plugin

 j4psh            JMX Shell

 AccessJ          iPhone Client

 Roo Addon        Spring Roo Addon


                                     22
j4psh




        23
Wrap up

• JMX is good
• JSR-160 connectors are bad
• Jolokia ...

        ... is a JSON-HTTP adaptor to JMX
        ... has unique features
        ... allows for non-Java clients
        ... has good tool support


                                            24
Resources

• www.jolokia.org
    • Reference-Manual: http://www.jolokia.org/reference/html/
    • Forum: http://www.jolokia.org/forum.html
• Blog
    • ConSol Labs: http://labs.consol.de
• Github
    • https://github.com/rhuss/jolokia
• T-Shirts ;-)
    • http://jolokia.spreadshirt.de
• Twitter: @jolokia_jmx
                                                                 25
Questions ?

More Related Content

PDF
JavaCro'14 - Using WildFly core to build high performance web server – Tomaž ...
PDF
Introduction to Node.js Platform
PDF
50 features of Java EE 7 in 50 minutes at JavaZone 2014
PDF
50 features of Java EE 7 in 50 minutes at Geecon 2014
PPTX
Silverstripe at scale - design & architecture for silverstripe applications
PPTX
Rapid API development examples for Impress Application Server / Node.js (jsfw...
PDF
Cli jbug
PDF
RESTful web service with JBoss Fuse
JavaCro'14 - Using WildFly core to build high performance web server – Tomaž ...
Introduction to Node.js Platform
50 features of Java EE 7 in 50 minutes at JavaZone 2014
50 features of Java EE 7 in 50 minutes at Geecon 2014
Silverstripe at scale - design & architecture for silverstripe applications
Rapid API development examples for Impress Application Server / Node.js (jsfw...
Cli jbug
RESTful web service with JBoss Fuse

What's hot (20)

PPTX
Java 9 sneak peek
KEY
DjangoCon 2010 Scaling Disqus
PDF
Mongo performance tuning: tips and tricks
PDF
Realtime web application with java
PDF
Service-Oriented Integration With Apache ServiceMix
KEY
What is the ServiceStack?
PDF
Making MySQL Administration a Breeze - A Look Into a MySQL DBA's Toolchest
PPTX
Melbourne User Group OAK and MongoDB
PDF
NodeJS ecosystem
PDF
MongoDB WiredTiger Internals: Journey To Transactions
PDF
Play Framework and Activator
PPTX
자바 성능 강의
PDF
Next Generation DevOps in Drupal: DrupalCamp London 2014
PDF
50 New Features of Java EE 7 in 50 minutes @ Devoxx France 2014
PPTX
Getting Started with Java EE 7
PPTX
Introduction to ServiceStack
PPTX
Cloudflare and Drupal - fighting bots and traffic peaks
PPTX
Concurrency Patterns with MongoDB
PDF
Play framework productivity formula
PDF
Using advanced options in MariaDB Connector/J
Java 9 sneak peek
DjangoCon 2010 Scaling Disqus
Mongo performance tuning: tips and tricks
Realtime web application with java
Service-Oriented Integration With Apache ServiceMix
What is the ServiceStack?
Making MySQL Administration a Breeze - A Look Into a MySQL DBA's Toolchest
Melbourne User Group OAK and MongoDB
NodeJS ecosystem
MongoDB WiredTiger Internals: Journey To Transactions
Play Framework and Activator
자바 성능 강의
Next Generation DevOps in Drupal: DrupalCamp London 2014
50 New Features of Java EE 7 in 50 minutes @ Devoxx France 2014
Getting Started with Java EE 7
Introduction to ServiceStack
Cloudflare and Drupal - fighting bots and traffic peaks
Concurrency Patterns with MongoDB
Play framework productivity formula
Using advanced options in MariaDB Connector/J
Ad

Similar to Jolokia - JMX on Capsaicin (Devoxx 2011) (20)

PDF
Spicing up JMX with Jolokia (Devoxx 2014)
PDF
Powering the Next Generation Services with Java Platform - Spark IT 2010
PDF
De Java 8 a Java 11 y 14
POTX
Splunking the JVM (Java Virtual Machine)
PDF
GlassFish REST Administration Backend at JavaOne India 2012
PDF
GlassFish REST Administration Backend
KEY
JMX Management Tools
PDF
GlassFish v3 Prelude Aquarium Paris
PDF
GlassFish v3 at JavaZone 09
PDF
Glass Fishv3 March2010
PDF
GlassFish v3 : En Route Java EE 6
PDF
Boston 2011 OTN Developer Days - Java EE 6
PPTX
Enterprise Spring Building Scalable Applications
PDF
Summer training java
PDF
Introducing JSR-283
KEY
Is OSGi modularity always worth it?
PDF
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
PDF
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
PDF
Java EE 6 & GlassFish v3: Paving the path for the future - Spark IT 2010
PPT
Summer training java
Spicing up JMX with Jolokia (Devoxx 2014)
Powering the Next Generation Services with Java Platform - Spark IT 2010
De Java 8 a Java 11 y 14
Splunking the JVM (Java Virtual Machine)
GlassFish REST Administration Backend at JavaOne India 2012
GlassFish REST Administration Backend
JMX Management Tools
GlassFish v3 Prelude Aquarium Paris
GlassFish v3 at JavaZone 09
Glass Fishv3 March2010
GlassFish v3 : En Route Java EE 6
Boston 2011 OTN Developer Days - Java EE 6
Enterprise Spring Building Scalable Applications
Summer training java
Introducing JSR-283
Is OSGi modularity always worth it?
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
Java EE 6 & GlassFish v3: Paving the path for the future - Spark IT 2010
Summer training java
Ad

Recently uploaded (20)

PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Approach and Philosophy of On baking technology
PPTX
Spectroscopy.pptx food analysis technology
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
KodekX | Application Modernization Development
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Unlocking AI with Model Context Protocol (MCP)
Dropbox Q2 2025 Financial Results & Investor Presentation
Mobile App Security Testing_ A Comprehensive Guide.pdf
cuic standard and advanced reporting.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
The Rise and Fall of 3GPP – Time for a Sabbatical?
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
Approach and Philosophy of On baking technology
Spectroscopy.pptx food analysis technology
20250228 LYD VKU AI Blended-Learning.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Per capita expenditure prediction using model stacking based on satellite ima...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
KodekX | Application Modernization Development
sap open course for s4hana steps from ECC to s4
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows

Jolokia - JMX on Capsaicin (Devoxx 2011)

  • 1. Jolokia - JMX on Capsaicin Roland Huß Chili-Head ConSol* Software GmbH
  • 2. Me and the Chili • Development and Operations @ ConSol – Large Java Projects – Remote Operations – Open Source Monitoring (Nagios) – www.consol.com • Open Source Author – roland@cpan.org – https://github.com/rhuss • Chili grower since 2005 2
  • 3. JMX JSR-3 JSR-160 The Problem
  • 4. JMX Refresher • Java Management Extensions (JMX) • JSR-3 (2000) • Available out of the box since JDK 1.5 • JMX-Operations: – Attribute reading – Attribute writing – Execution of operations – Notifications 4
  • 6. JMX Remote API • JSR-160 (2003) • Problems: – Firewalls – Security is typically „all-or-nothing“ – Strongly typed – Java only 6
  • 7. Jolokia Overview Features Clients Tools
  • 9. Agents JEE OSGi Mule JVM 9
  • 10. Tested on ... Tomcat 5.5, 6.0, 7.0 Felix 2.0, 3.2, 4.0 3.5, 3.6, Jetty 5.1, 6.1, 7.5, 8.0 Equinox 3.7, 3.8 M1 9.2.3, 10.0.2, Weblogic 10.3.5 Knopflerfish 3.2 Websphere 6.1, 7.0, 8.0 Virgo 2.1, 3.0 Glassfish 2.1, 3.0, 3.1 Spring dm Server 2.0 JBoss 4.2, 5.1, 6.1, 7.0 Mule 2.2, 3.1, 3.2 Jonas 4.10, 5.1, 5.2 ActiveMQ 5.5 Geronimo 2.1, 2.2, 3.0 M1 Terracotta 3.2 Camel 2.8 Hadoop 0.20 10
  • 12. Request • HTTP GET http://localhost/jolokia/read/java.lang:type=Memory/HeapMemoryUsage • HTTP POST { "type":"read", "mbean":"java.lang:type=Memory", "attribute":"HeapMemoryUsage" } 12
  • 13. Response { "value": { "init": 134217728, "max": 532742144, "committed": 133365760, "used": 19046472 }, "status": 200, "timestamp": 1244839118, "request": { "mbean": "java.lang:type=Memory", "type": "read", "attribute": "HeapMemoryUsage" } } 13
  • 14. Request Types version Version and server information read Reading of attributes write Writing of attributes exec Execution of operations search Pattern search for MBeans list MBean meta data 14
  • 15. Bulk Requests [ { "type" : "read", "mbean" : "java.lang:type=Memory", "attribute" : "HeapMemoryUsage", "path" : "used", }, { "type" : "search", "mbean" : "*:type=Memory,*" } ] 15
  • 17. Proxy Request { "attribute" : "HeapMemoryUsage", "mbean" : "java.lang:type=Memory", "target": { "url" : "service:jmx:iiop://websphere:2810/jndi/JMXConnector" "user" : "roland", "password" : "s!cr!t" }, "type" : "READ" } 17
  • 18. Security • JSR-160 Security – Java Security and JAAS • Jolokia Security – HTTP Security – Access Control with Policy Files • Network location • Command types • MBean, attribute and operation names 18
  • 19. Clients Perl Jmx4Perl Javascript Jolokia Java Jolokia Python Jmx4Py Jürgen Herrmann Node.js jolokia-client Joachim Kainz Groovy Scala You ? ..... 19
  • 21. Javascript var j4p = new Jolokia("/jolokia"); var data = []; function run() { j4p.request({ type: "read", mbean: "java.lang:type=Memory", attribute: "HeapMemoryUsage" }, { success: function(resp) { data.push([resp.timestamp,resp.value.used]); $.plot($("#memory"),[data],{ xaxis: { mode: "time" }}); setTimeout(run,1000); } }); } run(); 21
  • 22. Tools jmx4perl CLI Tool check_jmx4perl Nagios Plugin cacti_jmx4perl Cacti Plugin j4psh JMX Shell AccessJ iPhone Client Roo Addon Spring Roo Addon 22
  • 23. j4psh 23
  • 24. Wrap up • JMX is good • JSR-160 connectors are bad • Jolokia ... ... is a JSON-HTTP adaptor to JMX ... has unique features ... allows for non-Java clients ... has good tool support 24
  • 25. Resources • www.jolokia.org • Reference-Manual: http://www.jolokia.org/reference/html/ • Forum: http://www.jolokia.org/forum.html • Blog • ConSol Labs: http://labs.consol.de • Github • https://github.com/rhuss/jolokia • T-Shirts ;-) • http://jolokia.spreadshirt.de • Twitter: @jolokia_jmx 25