17 Mart 2023 Cuma

HazelcastClientAPI ClientConnectionStrategyConfig Sınıfı

Giriş
Şu satırı dahil ederiz
import com.hazelcast.client.config.ClientConnectionStrategyConfig;
getConnectionRetryConfig metodu

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);
setReconnectMode metodu
İmzası şöyle
public ClientConnectionStrategyConfig setReconnectMode(ReconnectMode reconnectMode)
ClientConnectionStrategyConfig.ReconnectMode.ON , ASYNC , OFF değerleri verilebilir. Açıklaması şöyle
... 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

THIRD-PARTY.txt Dosyası

Kullanılan harici kütüphanelerin sürümleri bu dosyada Dosyanın yolu şöyle hazelcast/licenses/THIRD-PARTY.txt