0
私はvertandフレームワークをcassandraで正確に英語の実装で使用しています。(https://github.com/ef-labs/vertx-cassandra) 私はlocalhostにDefaultCassandraSession
を使用します。
sesssionを確認しようとするとは初期化されません。ここでのコード:Vertand x with cassandra englishtownの実装
public class CassandraClientVerticle extends AbstractVerticle{
private CassandraSession session;
@Override
public void init(Vertx vertx, Context context) {
CassandraConfigurator configurator = new JsonCassandraConfigurator(vertx);
session = new DefaultCassandraSession(new Cluster.Builder(), configurator,vertx);
}
@Override
public void start() throws Exception {
System.out.println(session.initialized());
}
}
、これは私がこのVERTXと呼ばれるサーバーです:
public static void main(String[] args) {
Server server = null;
try {
server = new Server();
server.startServer();
} catch(Exception e) {
if(server != null) {
server.exit("Server execution failure", e);
} else {
LOG.error("Server execution failure", e);
}
}
}
public void startServer() throws Exception {
conf = Configuration.init();
Consumer<Vertx> runner = vertx -> {
try {
DeploymentOptions httpVerticleOptions = createHttpVerticleOptions();
vertx.deployVerticle(HttpVerticle.class.getName(), httpVerticleOptions);
vertx.deployVerticle(CassandraClientVerticle.class.getName());
} catch (Throwable t) {
exit("Vert.x runner failure", t);
}
};
VertxOptions vertxOptions = createVertxOptions();
vertx = Vertx.vertx(vertxOptions);
runner.accept(vertx);
}
私はセッションの問題を解決することができますか?私が見つけられなかった作業例をリンクしてください。