Search code examples
cassandralagom

How to configure multiple cassandra contact-points for lagom?


In Lagom it appears the contact point get loaded from the service locator which accepts only a single URI. How can we specify multiple cassandra contact-points?

lagom.services {
 cas_native = "tcp://10.0.0.120:9042"
}

I have tried setting just the contact points in the akka persistence config but that doesn't seem to override the service locator config.


Solution

  • All that I was missing was the session provider to override service lookup:

    session-provider = akka.persistence.cassandra.ConfigSessionProvider
    contact-points = ["10.0.0.120", "10.0.3.114", "10.0.4.168"]
    

    was needed in the lagom cassandra config