Skip to content
This repository was archived by the owner on May 3, 2022. It is now read-only.
This repository was archived by the owner on May 3, 2022. It is now read-only.

Easy-Cassandra and Spring's AnnotationConfigApplicationContext? #40

@Rastusik

Description

@Rastusik

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions