Skip to content

Instantly share code, notes, and snippets.

@lankydan
Created April 15, 2018 17:26
Show Gist options
  • Save lankydan/45dab6ed3159b62878c7c2c61f2b3834 to your computer and use it in GitHub Desktop.
Save lankydan/45dab6ed3159b62878c7c2c61f2b3834 to your computer and use it in GitHub Desktop.
Datastax driver - session creation
@Bean
public Session session(Cluster cluster, @Value("${cassandra.keyspace}") String keyspace) throws IOException {
final Session session = cluster.connect(keyspace);
// any other setup
return session;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment