Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5A78F1006F for ; Wed, 9 Apr 2014 07:49:29 +0000 (UTC) Received: (qmail 37754 invoked by uid 500); 9 Apr 2014 07:49:25 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 37282 invoked by uid 500); 9 Apr 2014 07:49:24 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 37274 invoked by uid 99); 9 Apr 2014 07:49:23 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Apr 2014 07:49:23 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of doanduyhai@gmail.com designates 209.85.214.177 as permitted sender) Received: from [209.85.214.177] (HELO mail-ob0-f177.google.com) (209.85.214.177) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Apr 2014 07:49:19 +0000 Received: by mail-ob0-f177.google.com with SMTP id wo20so2211608obc.36 for ; Wed, 09 Apr 2014 00:48:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=NE18AdZ5gOKgN2lJt1gGmCRUzIXPfGV4EEsvI6G/TxU=; b=T8rqkwaVVLYqsty1wBiIuP9XJIs1EiJEXUJ9bf0cyDsJuUq8n8JgLjByb8i7RbA414 kGG2u1I/OBYRbt9xGR0gD+GLd4qUxe3gbDpRqHh/dAXy32xDHbde2XEb2K2A7GH0UpUT UtPHJWNiWE9ILDJyvoTws6Qe90H6sXs1BkHaKkERj/Te36wMGA9l8K2SXI0uq2wVKjTH QhIz/g4CAgWSSVmPfBRbZMzWqA+HqK9+YyurshXt/T0ptGesQ5IDPCg+vlqxMRJwGiNp oAuI8SH+sc9Y8sUfKtnAv3/AvaE4sWTGmlAEsD2Qr+RaEadOxsrvz3SwC7jLpVxzVL3h MLUw== MIME-Version: 1.0 X-Received: by 10.183.1.34 with SMTP id bd2mr7619166obd.4.1397029736921; Wed, 09 Apr 2014 00:48:56 -0700 (PDT) Received: by 10.76.109.4 with HTTP; Wed, 9 Apr 2014 00:48:56 -0700 (PDT) In-Reply-To: <882BA080-1B92-4856-8324-2904382FCBFF@vast.com> References: <882BA080-1B92-4856-8324-2904382FCBFF@vast.com> Date: Wed, 9 Apr 2014 09:48:56 +0200 Message-ID: Subject: Re: binary protocol server side sockets From: DuyHai Doan To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=001a1134acc235c1d804f697559f X-Virus-Checked: Checked by ClamAV on apache.org --001a1134acc235c1d804f697559f Content-Type: text/plain; charset=ISO-8859-1 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 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 --001a1134acc235c1d804f697559f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hello Graham

=A0You can use the followi= ng code with the official Java driver:

=A0SocketOp= tions socketOptions =3D new SocketOptions();
=A0socketOptions.set= KeepAlive(true);

=A0Cluster.builder().addContactPoints(contactPointsList= )
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=A0.withPort(cql= 3Port)
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 .withCompr= ession(ProtocolOptions.Compression.SNAPPY)
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 .withCredentials(cassa= ndraUsername, cassandraPassword)
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 .withSocketOptions(socketOptions)
=A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 .build();

=A0or :

=A0alreadyBuiltClusterInstance.getConfigur= ation().getSocketOptions().setKeepAlive(true);

=A0Althought I'm not sure if the second alternative does wo= rk because the cluster is already built and maybe the connection is already= established...

=A0Regards

=A0Duy Hai DOAN


On We= d, 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

--001a1134acc235c1d804f697559f--