ef-labs / vertx-cassandra

Execute cassandra statements from a vert.x module
39 stars 19 forks source link

Session is null #23

Open RicardoPRamalho opened 8 years ago

RicardoPRamalho commented 8 years ago

For some reason, when I inject an instance of CassandraSession, the com.datastax.driver.core.Session inside it is always null, if I tries to reconnect using "reconnect()" method and execute a query, it throws an exception with the message: "Cassandra session is not ready for use yet".

Could you provide an useful example of how to use vertx-cassandra, or figure out what I'm doing wrong?

Thanks

adrianluisgonzalez commented 8 years ago

If you have a simple reproducer I can take a look.

My guess is you are not waiting for CassandraSession.onReady(). Have you had a look at the integration tests?
https://github.com/ef-labs/vertx-cassandra/blob/develop/vertx-cassandra/src/test/java/com/englishtown/vertx/cassandra/integration/IntegrationTestBase.java#L75