Coder
Coder

Reputation: 183

How to refresh cassandra contact-points without application restart? Cassandra Driver 4.4. URL refresh support

I have seen this feature that reloads the config from a URL: https://docs.datastax.com/en/drivers/java/4.0/com/datastax/oss/driver/api/core/config/DriverConfigLoader.html#fromUrl-java.net.URL-

Do we have anything to refresh the properties inside the jar without restarting the jvm in spring-data-cassandra?

https://mvnrepository.com/artifact/org.springframework.data/spring-data-cassandra/2.2.4.RELEASE Spring Data Cassandra does not support 4.4 datastax driver version

Thanks,

Cheers

Upvotes: 0

Views: 1189

Answers (1)

adutra
adutra

Reputation: 4536

See basic.config-reload-interval in the driver configuration, or check our documentation on configuration: the driver will automatically reload its configuration, by default every 5 minutes.

However contact points are generally only useful at session initialization: once the session is initialized, the driver maintains a set of available nodes that reflects the actual state of the cluster. You shouldn't need to refresh contact points, unless your application creates many CqlSession objects (which is an anti-pattern).

Upvotes: 1

Related Questions