I'm using micronaut framework and I'm trying to configure cassandra data access from application.yml
For a standard test use case I'm able to configure the datastax driver
cassandra:
default:
clusterName: "Test Cluster"
contactPoint: "192.168.99.100"
port: 9042
maxSchemaAgreementWaitSeconds: 20
ssl: false
However I can't find a way to provide the configuration to be used with the method .withCredentials
I see that the implementation in https://github.com/micronaut-projects/micronaut-core/blob/dc8c423be1979817c9c8f53440f3b87e775523b2/configurations/cassandra/src/main/java/io/micronaut/configuration/cassandra/CassandraConfiguration.java
do the following
@ConfigurationBuilder(allowZeroArgs = true, prefixes = { "with", "add" })
Cluster.Builder builder = Cluster.builder();
however withCredentials method requires 2 parameters https://docs.datastax.com/en/drivers/java/2.0/com/datastax/driver/core/Cluster.Builder.html#withCredentials-java.lang.String-java.lang.String-
public Cluster.Builder withCredentials(String username,
String password)
What would be the yaml way to provide the configuration to this method?
CassandraConfigurationto make the builder accessible to programatic customisation. Please feel free to report an issue for this. - Graeme Rocher