質問

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