Skip to content

Commit

Permalink
#527 Increase connection to Cassandra timeout (#536)
Browse files Browse the repository at this point in the history
  • Loading branch information
2m authored and raboof committed Oct 19, 2017
1 parent 178a0ed commit 707d9ff
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package akka.stream.alpakka.cassandra.scaladsl
import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
import akka.stream.scaladsl.{Sink, Source}
import com.datastax.driver.core.{Cluster, PreparedStatement, SimpleStatement}
import com.datastax.driver.core.{Cluster, PreparedStatement, SimpleStatement, SocketOptions}
import org.scalatest._
import org.scalatest.concurrent.ScalaFutures

Expand All @@ -30,7 +30,15 @@ class CassandraSourceSpec
//#init-mat

//#init-session
implicit val session = Cluster.builder.addContactPoint("127.0.0.1").withPort(9042).build.connect()
implicit val session = Cluster.builder
.addContactPoint("127.0.0.1")
.withPort(9042)
.withSocketOptions(
new SocketOptions()
.setConnectTimeoutMillis(20 * 1000)
)
.build
.connect()
//#init-session

implicit val defaultPatience =
Expand Down

0 comments on commit 707d9ff

Please sign in to comment.