Will Couchbase client connection become stale?

I have a long-running server using the couchbase client 2.2.3 to talk to a couchbase cluster. I wonder if the connection will become stale eventually or it can refresh itself automatically. Do I need to periodically disconnect the connection and manually create a new connection through CouchbaseCluster.create() periodically?


@jzeng no, the client takes care of it automatically. We are using a heartbeat polling mechanism to make sure the tcp connections are not cut off by a firewall or something. So even longer periods of time where no activity occurs should be fine.

Please make sure to only ever create one Cluster instance and reuse it across the lifetime of your application. Same with Bucket instances if you can :slight_smile:

1 Like