Giriş
Şu satırı dahil ederiz
import com.hazelcast.client.config.ClientConnectionStrategyConfig;
getConnectionRetryConfig metodu
ConnectionRetryConfig döner
setAsyncStart metodu
Örnek
Şöyle yaparız.
ClientConfig clientConfig = new ClientConfig(); ... ClientConnectionStrategyConfig connectionStrategyConfig = clientConfig .getConnectionStrategyConfig(); connectionStrategyConfig .setAsyncStart(true) .setReconnectMode(ClientConnectionStrategyConfig.ReconnectMode.ASYNC); ... HazelcastInstance clientInstance = HazelcastClient.newHazelcastClient(clientConfig);
İmzası şöyle
public ClientConnectionStrategyConfig setReconnectMode(ReconnectMode reconnectMode)
... the client will try to reconnect both in the ON and ASYNC modes. The difference comes from the fate of the pending invocations during that time. With the ON mode, the requests are blocked i.e. you don't get a result back for your API calls until the client reconnects. With the ASYNC mode, requests are failed immediately with the HazelcastClientOfflineException.
Hiç yorum yok:
Yorum Gönder