Bucket disconnected


Assume that my network is down for couple of sec/min and after that it is up again. Does the java client knows to reconnect or will get some exception and will have to reconnect my cluster and bucket?

Yes, the java client is supposed to reconnect to the node with a increasing back-off. It will only stop doing so if it is instructed with a new configuration that the node has left the cluster.

Is that what you’ve expected or did you experience something else?

This is the behavior I expected, in version prior 2.x it didn’t work so well. I will check it now with 2.x and see


Hm, it should work there well too. Have you tried the latest 1.4 and/or can you share what happened?

Currently I can’t share :frowning:
But maybe I will after running tests again with latest client.

Another question is:
My couchbase connection is initialized by a spring bean init method, in case couchbase cluster is down from some reason, I want my service to go up and periodically to check the status of couchbase and connect if available.

Are you familiar with such cases?

@ohassidi, I have a similar problem, did you find any solution to that?

@baawhee you are seeing the client not reconnecting sockets when they go down? Can you share more info?

@daschl, when I start the application with Couchbase Server already running everything is fine, the connection is established at the beginning and if I stop the server and then run it again the client is reconnecting properly. I am looking for a solution that will work when I start the application without Couchbase Server ready. I need a mechanism that will periodically try to reconnect to Couchbase when I start app without it. In current situation SDK tries to connect few times at the beginning and then stops. When I turn on the CB server later client won’t connect. I don’t know if Couchbase SDK provide that mechanism out of the box, probably it’s something that I need to implement.
I think I will try to go with @Scheduled annotation.
@daschl, one more question, when I invoke Cluster.connect(…), it tries to reconnect multiple times, how to limit the amount of retries? RetryStrategy seems to not apply while reconnecting, is this a matter of proper timeouts?