Skip to content

Instantly share code, notes, and snippets.

@MiraLak
Created May 31, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MiraLak/14d835992cf2980ceebe to your computer and use it in GitHub Desktop.
Save MiraLak/14d835992cf2980ceebe to your computer and use it in GitHub Desktop.
Accelerometer to Cassandra REST Api
@Configuration
@PropertySource(value = { "classpath:cassandra.properties" })
public class CassandraConfiguration extends AbstractCassandraConfiguration {
@Autowired
private Environment environment;
@Bean
public CassandraClusterFactoryBean cluster() {
CassandraClusterFactoryBean cluster = new CassandraClusterFactoryBean();
cluster.setContactPoints(environment.getProperty("cassandra.contactpoints"));
cluster.setPort(Integer.parseInt(environment.getProperty("cassandra.port")));
return cluster;
}
@Override
protected String getKeyspaceName() {
return environment.getProperty("cassandra.keyspace");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment