Spring-boot: Configure Cassandra JMX Reporting

Created on 10 Oct 2018  路  8Comments  路  Source: spring-projects/spring-boot

The upgrade to Dropwizard 4 means that we need to customize Cassandra to disable JMX reporting. We should also offer the user a way to re-enable it, if they wish.

enhancement

Most helpful comment

I think this is bigger than just disabling jmx. The spring boot bom for 2.1.0 lists incompatible dependencies:

com.datastax.cassandra:cassandra-driver-core:3.6.0
io.dropwizard.metrics:metrics-jmx:4.0.3

The problem is that cassandra-driver-core 3.6.0 depends on dropwizard version 3.2.2. Version 4.0.3 includes a breaking change which causes class not found errors.

All 8 comments

Reopening to rename property to jmx-enabled to align with existing properties.

Note: the new property should be added to the appendix as well

Hello

I Just updated my project to version 2.1.0.RELEASE.
But now I get the following error:

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.cassandra.ReactiveSession]: Factory method 'reactiveSession' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'session' defined in class path resource [CassandraConfig.class]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: com/codahale/metrics/JmxReporter

Am I missing something? M4 worked properly with autoconfiguration.

@thrashermaq I'm guessing this is your question on Stack Overflow? If so, let's keep the discussion there please.

I think this is bigger than just disabling jmx. The spring boot bom for 2.1.0 lists incompatible dependencies:

com.datastax.cassandra:cassandra-driver-core:3.6.0
io.dropwizard.metrics:metrics-jmx:4.0.3

The problem is that cassandra-driver-core 3.6.0 depends on dropwizard version 3.2.2. Version 4.0.3 includes a breaking change which causes class not found errors.

@hookumsnivy As far as we know, Cassandra's driver only uses Dropwizard for JMX-based reporting. With reporting disabled, we are not aware of any incompatibilities with Boot's default version of Dropwizard Metrics. If you have evidence to the contrary, please open a new issue with an sample project that reproduces the problem.

So there is no way for us to enable jmx-reporting in spring boot2 for Datastax Cassandra?

You can enable reporting by setting the spring.data.cassandra.jmx-enabled property to true and downgrading Dropwizard Metrics to a version that's compatible with Cassandra's JMX reporting.

If you have any further questions, please follow up on Stack Overflow or Gitter. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements.

Was this page helpful?
0 / 5 - 0 ratings