Вопрос

I have a Hazelcast client application which will sometimes be started before any server in the cluster. Before I start building this myself.

Is there any built in support in Hazelcast to make the client wait for the cluster to start up and then connect to it?

Это было полезно?

Решение

Yes you can set the connectionAttemptLimit on the ClientConfig.

connectionAttemptLimit: the maximum numbers of times to try the addresses to connect to the cluster, defaults to 2. When a client starts or a the client looses connecting with the cluster, it will try to make a connection with one of the cluster member addresses. In some cases a client can’t connect to these addresses, e.g. the cluster is not yet up or not reachable. Instead of giving up, one can increase the attempt limit to create a connection. Also have a look at the connectionAttemptPeriod.

Другие советы

I found this and it worked for me: <hz:network connection-attempt-limit="50" connection-attempt-period="5000" connection-timeout="1000" redo-operation="true"> <hz:member>

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top