Easy-Cassandra icon indicating copy to clipboard operation
Easy-Cassandra copied to clipboard

Easy-Cassandra and Spring's AnnotationConfigApplicationContext?

Open Rastusik opened this issue 11 years ago • 5 comments

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.

Rastusik avatar May 04 '14 17:05 Rastusik

@otaviojava Could you please review this? https://github.com/probepark/Easy-Cassandra/commit/375b0c1ab61597e827d283052c63f6beef2fb505

probepark avatar May 30 '14 04:05 probepark

@Rastusik I am not tested with Spring 4 yet.

otaviojava avatar May 30 '14 07:05 otaviojava

@otaviojava I'll check it when I come back from work, thanks for the reply

Rastusik avatar May 30 '14 07:05 Rastusik

looks like it doesn't work, still the same issue

Rastusik avatar May 31 '14 00:05 Rastusik

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.

Rastusik avatar May 31 '14 00:05 Rastusik