Support Questions
Find answers, ask questions, and share your expertise

How to close the Cassandra connection established in the Nifi SprnigContextProcessor

How to close the Cassandra connection established in the Nifi SprnigContextProcessor

Rising Star

Hello,

I have a Nifi SpringContextProcessor which is establishing connection to the Cassandra.

On processor START it is establishing the connection, but on processor STOP it is not releasing the connection consistently. (Some time it release and some time it does not)


Do you have any idea how I can handle this connection?


Below is the piece of code used for connection -


session = DseCluster.builder()

.addContactPoint(cassandraUrl)

.withPort(cassandraPort)

.withSpeculativeExecutionPolicy(

new ConstantSpeculativeExecutionPolicy(

500, // delay before a new execution is launched

2 // maximum number of executions

)

)

.withAuthProvider(new DseGSSAPIAuthProvider("HTTP"))

.build()

.register(QueryLogger.builder()

.withConstantThreshold(100)

.withMaxQueryStringLength(20)

.build())

.connect(cassandraKeySpace);


Thanks

Mahendra