Cassandra connection

633 views
Skip to first unread message

Ahmed Bouzaien

unread,
Jul 18, 2014, 6:29:48 AM7/18/14
to ve...@googlegroups.com
Hello everyone,

Currently I am working on a POC which aims to connect my Vert.x web application to Cassandra database, I used this module: https://github.com/nea/vertx-mod-cassandra-persistor
But I am getting the following error:
[Cassandra Persistor] Booting up...
[Cassandra Persistor] Cannot add hosts ["127.0.0.1"]
java.lang.IllegalStateException: The requested compression is not available (some compression require a JAR to be found in the classpath)
        at com.datastax.driver.core.ProtocolOptions.setCompression(ProtocolOptions.java:178)


My source code (copied from the test class of the module) is the following:
        JsonObject config = new JsonObject();
        config.putArray("hosts", new JsonArray().add("127.0.0.1"));
        config.putString("compression", "SNAPPY");
        config.putString("retry", "fallthrough");
        config.putObject("reconnection", new JsonObject().putString("policy", "constant").putNumber("delay", 1000));

        container.deployModule("com.insanitydesign~vertx-mod-cassandra-persistor~0.3.1", config, 1, new AsyncResultHandler<String>() {
            public void handle(AsyncResult<String> asyncResult) {
                container.logger().info("Does deployment succeded: " +asyncResult.succeeded());
                container.logger().info("deploymentID should not be null: "+ asyncResult.result());
            }
        });


Any ideas what the problem might be?
Thanks in advance for you help!

Regards,
Ahmed

Ahmed Bouzaien

unread,
Jul 18, 2014, 7:09:05 AM7/18/14
to ve...@googlegroups.com
Finally I resolved the issue by removing this instruction:

config.putString("compression", "SNAPPY");
But I don't understand why it works fine in the test example of https://github.com/nea/vertx-mod-cassandra-persistor.

Regards,
Ahmed.

Brice Dutheil

unread,
Jul 18, 2014, 12:08:39 PM7/18/14
to ve...@googlegroups.com
I believe you need to add the snappy.jar in the classpath, otherwise it doesn't work

-- Brice


--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages