Easy-Cassandra and Spring's AnnotationConfigApplicationContext?
Hi, I'm trying to integrate Easy-cassandra into my app, which uses Spring with its AnnotationConfigApplicationContext.
I was able to instantiate CassandraFactoryAnnotation like this:
@Bean
public CassandraFactoryAnnotation cassandraFactoryAnnotation(){
CassandraFactoryAnnotation cfa = new CassandraFactoryAnnotation(cassandraClusterInformation());
List<Class<?>> annotatedClasses = new LinkedList<Class<?>>();
annotatedClasses.add(TtfDocument.class);
cfa.setAnnotatedClasses(annotatedClasses);
return cfa;
}
public ClusterInformation cassandraClusterInformation()
{
ClusterInformation ci = new ClusterInformation();
ci.setKeySpace("traveladvisor");
ci.addHost("localhost");
return ci;
}
The code seems to work, but my application doesn't want to quit, even when there's no usage of cassandra. When the CassandraFactoryAnnotation bean gets instantialised, the app doesn't want to stop.
It looks like the Cassandra Java Driver worker threads don't stop.
Any ideas why? Have I done something wrong? I am using the Spring 4.0.0.RELEASE version.
Thanks.
@otaviojava Could you please review this? https://github.com/probepark/Easy-Cassandra/commit/375b0c1ab61597e827d283052c63f6beef2fb505
@Rastusik I am not tested with Spring 4 yet.
@otaviojava I'll check it when I come back from work, thanks for the reply
looks like it doesn't work, still the same issue
also, I don't know why, but the tests keep failing on my setup after the build. are there any necessary steps to run them correctly? or for which cassandra version are they written? the problem is, that some tests are ok, but some of them (always the same ones) always fail.