Giriş
Şu satırı dahil ederiz
import com.hazelcast.client.config.ConnectionRetryConfig;
setClusterConnectTimeoutMillis metodu
Cluster'a bağlanma zaman aşımı süresini belirtir.
Örnek
Şöyle yaparız.
ClientConfig clientConfig = new ClientConfig(); ... ClientConnectionStrategyConfig connectionStrategyConfig = clientConfig .getConnectionStrategyConfig(); connectionStrategyConfig .setAsyncStart(true) .setReconnectMode(ClientConnectionStrategyConfig.ReconnectMode.ASYNC); ConnectionRetryConfig connectionRetryConfig = connectionStrategyConfig .getConnectionRetryConfig(); connectionRetryConfig .setInitialBackoffMillis(1_000) .setMaxBackoffMillis(60_000) .setMultiplier(2) .setClusterConnectTimeoutMillis(50_000) .setJitter(0.2); HazelcastInstance clientInstance = HazelcastClient.newHazelcastClient(clientConfig);
Hiç yorum yok:
Yorum Gönder