Class RedisClusterConnectOptions

    • Constructor Detail

      • RedisClusterConnectOptions

        public RedisClusterConnectOptions()
      • RedisClusterConnectOptions

        public RedisClusterConnectOptions​(RedisOptions options)
      • RedisClusterConnectOptions

        public RedisClusterConnectOptions​(JsonObject json)
    • Method Detail

      • getUseReplicas

        public RedisReplicas getUseReplicas()
        Get whether to use replica nodes for read only queries.
        Returns:
        the cluster replica node use mode.
      • setUseReplicas

        public RedisClusterConnectOptions setUseReplicas​(RedisReplicas useReplicas)
        Set whether to use replica nodes for read only queries.
        Parameters:
        useReplicas - the cluster replica use mode.
        Returns:
        fluent self.
      • getHashSlotCacheTTL

        public long getHashSlotCacheTTL()
        Returns the TTL of the hash slot cache. The TTL is expressed in milliseconds. Defaults to 1000 millis (1 second).
        Returns:
        the TTL of the hash slot cache
      • setHashSlotCacheTTL

        public RedisClusterConnectOptions setHashSlotCacheTTL​(long hashSlotCacheTTL)
        Sets the TTL of the hash slot cache. The TTL is expressed in milliseconds. Defaults to 1000 millis (1 second).
        Parameters:
        hashSlotCacheTTL - the TTL of the hash slot cache, in millis
      • getClusterTransactions

        public RedisClusterTransactions getClusterTransactions()
        Get how Redis transactions are handled in cluster mode.
        Returns:
        how transactions are handled
      • setClusterTransactions

        public RedisClusterConnectOptions setClusterTransactions​(RedisClusterTransactions clusterTransactions)
        Set how Redis transactions are handled in cluster mode.
        Parameters:
        clusterTransactions - transaction handling mode
        Returns:
        fluent self
      • setProtocolNegotiation

        public RedisClusterConnectOptions setProtocolNegotiation​(boolean protocolNegotiation)
        Description copied from class: RedisConnectOptions
        Should the client perform REST protocol negotiation during the connection acquire. By default this is true, but there are situations when using broken servers it may be useful to skip this and always fallback to RESP2 without using the HELLO command.
        Overrides:
        setProtocolNegotiation in class RedisConnectOptions
        Parameters:
        protocolNegotiation - false to disable HELLO (not recommended) unless reasons...
        Returns:
        fluent self
      • setEndpoints

        public RedisClusterConnectOptions setEndpoints​(List<String> endpoints)
        Description copied from class: RedisConnectOptions
        Set the endpoints to use while connecting to the redis server. Only the cluster mode will consider more than 1 element. If more are provided, they are not considered by the client when in single server mode.
        Overrides:
        setEndpoints in class RedisConnectOptions
        Parameters:
        endpoints - list of socket addresses.
        Returns:
        fluent self.
      • addConnectionString

        public RedisClusterConnectOptions addConnectionString​(String connectionString)
        Description copied from class: RedisConnectOptions
        Adds a connection string (endpoint) to use while connecting to the redis server. Only the cluster mode will consider more than 1 element. If more are provided, they are not considered by the client when in single server mode.
        Overrides:
        addConnectionString in class RedisConnectOptions
        Parameters:
        connectionString - a string URI following the scheme: redis://[username:password@][host][:port][/database]
        Returns:
        fluent self.
        See Also:
        Redis scheme on iana.org
      • setMaxWaitingHandlers

        public RedisClusterConnectOptions setMaxWaitingHandlers​(int maxWaitingHandlers)
        Description copied from class: RedisConnectOptions
        The client will always work on pipeline mode, this means that messages can start queueing. You can control how much backlog you're willing to accept. This methods sets how much handlers is the client willing to queue.
        Overrides:
        setMaxWaitingHandlers in class RedisConnectOptions
        Parameters:
        maxWaitingHandlers - max allowed queued waiting handlers.
        Returns:
        fluent self.