How to persist using custom coonnection Object


I am using Cassandra to store my events so I have installed it locally and I gave necessary information in application.conf file and it is working fine.

When I go for a release I am restricted to use our own Cassandra. It has our own wrapper class to connect and query with the db.

How can I achieve this because we are just giving IP and port there is no option to pass our connection object.

Do we have any method to overridde, so that I can use our wrapper and connect.


Yes, you can customize the SessionProvider class to add your own custom logic.

See the configuration for how to set this:

…and the SessionProvider trait you can implement:

…and the default ConfigSessionProvider implementation you can extend: