21.4. Enable JMX for Cache Instances


At the Cache level, JMX statistics can be enabled either declaratively or programmatically, as follows.
Enable JMX Declaratively at the Cache Level (Library mode)

Add the following snippet within either the <default> element for the default cache instance, or under the target <namedCache> element for a specific named cache:

<jmxStatistics enabled="true"/>
Copy to Clipboard Toggle word wrap
Enable JMX Programmatically at the Cache Level (Library mode)

Add the following code to programmatically enable JMX at the cache level:

Configuration configuration = new
ConfigurationBuilder().jmxStatistics().enable().build();
Copy to Clipboard Toggle word wrap
Enable JMX Declaratively at the Cache Level (Remote Client-Server mode)

Add the following code to declaratively enable JMX at the cache level:

<local-cache name="default" start="EAGER" statistics="true">
Copy to Clipboard Toggle word wrap

Note

To disable the JMX statistics in the Library mode, set the enabled property to "false" and for Remote Client-Server mode, set the statistics property to "false."
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2026 Red Hat
Back to top