# Copyright (c) 2008-2024, Hazelcast, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Hazelcast client configuration for FT QoE Web.
#
# Place this file at the path specified by CACHE_CONFIG_PATH
# (e.g., /etc/app/cache/hazelcast-client.yaml).
#
# To learn how to configure Hazelcast, please see the Reference Manual
# at https://docs.hazelcast.com/

hazelcast-client:
  # Must match the cluster-name configured on the Hazelcast server side
  cluster-name: dev

  properties:
    hazelcast.client.shuffle.member.list: true
    hazelcast.client.heartbeat.timeout: 60000
    hazelcast.client.heartbeat.interval: 5000
    hazelcast.client.event.thread.count: 5
    hazelcast.client.event.queue.capacity: 1000000
    hazelcast.client.invocation.timeout.seconds: 120

  network:
    # List of addresses for the client to try to connect to.
    # All members of a Hazelcast cluster accept client connections.
    # Use the format <hostname>:<port>
    # If a port number is not specified, port range 5701-5703 will be tried.
    cluster-members:
      - 127.0.0.1:5701
    # Whether client should discover and connect to other members in the
    # cluster and route requests to them, or only connect to the listed members.
    cluster-routing:
      mode: "ALL_MEMBERS"
    redo-operation: true
    connection-timeout: 60000
    socket-options:
      tcp-no-delay: false
      keep-alive: true
      reuse-address: true
      linger-seconds: 3
      buffer-size: 128

  near-cache:
    default:
      time-to-live-seconds: 90
      max-idle-seconds: 100
      invalidate-on-change: true
      in-memory-format: OBJECT
      serialize-keys: true
      local-update-policy: INVALIDATE
      preloader:
        enabled: false
        directory: directory
        store-initial-delay-seconds: 50
        store-interval-seconds: 10

  connection-strategy:
    async-start: false
    reconnect-mode: ASYNC
    connection-retry:
      initial-backoff-millis: 2000
      max-backoff-millis: 60000
      multiplier: 3
      cluster-connect-timeout-millis: 120000
      jitter: 0.5

  user-code-deployment:
    enabled: false
