Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To be able to define contactPoints with ports in the configuration. #581

Closed
vejeta opened this issue Oct 4, 2016 · 1 comment
Closed

Comments

@vejeta
Copy link
Contributor

vejeta commented Oct 4, 2016

Version: 0.10.1-SNAPSHOT
Module: quill-cassandra
Database: cassandra

Expected behavior

It would be very convenient to be able to define contactPoints with ports in the configuration.
We can define an array of hosts like

contactPoints = ["127.0.0.1:9042", "127.0.0.2:9042"]

but we can't define it with their corresponding ports.

contactPoints = ["127.0.0.1:9042", "127.0.0.2:9042"]

Actual behavior

[error] Exception in thread "main" java.lang.IllegalStateException: Invalid config key 'contactPoints'
[error]     at io.getquill.util.Messages$.fail(Messages.scala:8)
[error]     at io.getquill.context.cassandra.cluster.ClusterBuilder$$anonfun$io$getquill$context$cassandra$cluster$ClusterBuilder$$set$2.io$getquill$context$cassandra$cluster$ClusterBuilder$$anonfun$$tryMethods$1(ClusterBuilder.scala:45)
[error]     at io.getquill.context.cassandra.cluster.ClusterBuilder$$anonfun$io$getquill$context$cassandra$cluster$ClusterBuilder$$set$2$$anonfun$io$getquill$context$cassandra$cluster$ClusterBuilder$$anonfun$$tryMethods$1$1.apply(ClusterBuilder.scala:46)
[error]     at scala.util.Try.getOrElse(Try.scala:79)
[error]     at io.getquill.context.cassandra.cluster.ClusterBuilder$$anonfun$io$getquill$context$cassandra$cluster$ClusterBuilder$$set$2.io$getquill$context$cassandra$cluster$ClusterBuilder$$anonfun$$tryMethods$1(ClusterBuilder.scala:46)
[error]     at io.getquill.context.cassandra.cluster.ClusterBuilder$$anonfun$io$getquill$context$cassandra$cluster$ClusterBuilder$$set$2$$anonfun$io$getquill$context$cassandra$cluster$ClusterBuilder$$anonfun$$tryMethods$1$1.apply(ClusterBuilder.scala:46)
[error]     at scala.util.Try.getOrElse(Try.scala:79)
[error]     at io.getquill.context.cassandra.cluster.ClusterBuilder$$anonfun$io$getquill$context$cassandra$cluster$ClusterBuilder$$set$2.io$getquill$context$cassandra$cluster$ClusterBuilder$$anonfun$$tryMethods$1(ClusterBuilder.scala:46)
[error]     at io.getquill.context.cassandra.cluster.ClusterBuilder$$anonfun$io$getquill$context$cassandra$cluster$ClusterBuilder$$set$2$$anonfun$io$getquill$context$cassandra$cluster$ClusterBuilder$$anonfun$$tryMethods$1$1.apply(ClusterBuilder.scala:46)
[error]     at scala.util.Try.getOrElse(Try.scala:79)
[error]     at io.getquill.context.cassandra.cluster.ClusterBuilder$$anonfun$io$getquill$context$cassandra$cluster$ClusterBuilder$$set$2.io$getquill$context$cassandra$cluster$ClusterBuilder$$anonfun$$tryMethods$1(ClusterBuilder.scala:46)
[error]     at io.getquill.context.cassandra.cluster.ClusterBuilder$$anonfun$io$getquill$context$cassandra$cluster$ClusterBuilder$$set$2.apply(ClusterBuilder.scala:49)
[error]     at io.getquill.context.cassandra.cluster.ClusterBuilder$$anonfun$io$getquill$context$cassandra$cluster$ClusterBuilder$$set$2.apply(ClusterBuilder.scala:18)
[error]     at scala.collection.mutable.HashSet.foreach(HashSet.scala:78)
[error]     at io.getquill.context.cassandra.cluster.ClusterBuilder$.io$getquill$context$cassandra$cluster$ClusterBuilder$$set(ClusterBuilder.scala:18)
[error]     at io.getquill.context.cassandra.cluster.ClusterBuilder$.apply(ClusterBuilder.scala:15)
[error]     at io.getquill.CassandraContextConfig.builder(CassandraContextConfig.scala:13)
[error]     at io.getquill.CassandraContextConfig.cluster(CassandraContextConfig.scala:14)
[error]     at io.getquill.CassandraAsyncContext.<init>(CassandraAsyncContext.scala:21)
[error]     at io.getquill.CassandraAsyncContext.<init>(CassandraAsyncContext.scala:22)

Steps to reproduce the behavior

Have a config file with:

session.contactPoints = ["127.0.0.1:9042", "127.0.0.2:9042"]

and then:

  val ctx: CassandraAsyncContext[SnakeCase] = new CassandraAsyncContext[SnakeCase](config)

Workaround

Create the cassandra context passing a ClusterBuilder.

@getquill/maintainers

@fwbrasil
Copy link
Collaborator

fixed by #395

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants