incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DuyHai Doan <doanduy...@gmail.com>
Subject Re: binary protocol server side sockets
Date Wed, 09 Apr 2014 07:48:56 GMT
Hello Graham

 You can use the following code with the official Java driver:

 SocketOptions socketOptions = new SocketOptions();
 socketOptions.setKeepAlive(true);

 Cluster.builder().addContactPoints(contactPointsList)
                        .withPort(cql3Port)
                        .withCompression(ProtocolOptions.Compression.SNAPPY)
                        .withCredentials(cassandraUsername,
cassandraPassword)
                        .withSocketOptions(socketOptions)
                        .build();

 or :

 alreadyBuiltClusterInstance.getConfiguration().getSocketOptions().setKeepAlive(true);


 Althought I'm not sure if the second alternative does work because the
cluster is already built and maybe the connection is already established...

 Regards

 Duy Hai DOAN


On Wed, Apr 9, 2014 at 12:59 AM, graham sanderson <graham@vast.com> wrote:

> Is there a way to configure KEEPALIVE on the server end sockets of the
> binary protocol.
>
> rpc_keepalive only affects thrift.
>
> This is on 2.0.5
>
> Thanks,
>
> Graham

Mime
View raw message