Skip to content

Implement builder pattern of JedisPool and JedisCluster #1780

@warrenzhu25

Description

@warrenzhu25

Expected behavior

Currently, the JedisCluster constructor has at most 7 parameter.
Now

  public JedisCluster(HostAndPort node, int connectionTimeout, int soTimeout,
          int maxAttempts, String password, String clientName, final GenericObjectPoolConfig poolConfig) {
  }

After adding support SSL in JedisCluster #1550, the number become 12

  public JedisCluster(Set<HostAndPort> jedisClusterNode, int connectionTimeout, int soTimeout,
                      int maxAttempts, String password, String clientName, final GenericObjectPoolConfig poolConfig,
                      boolean ssl, SSLSocketFactory sslSocketFactory, SSLParameters sslParameters, 
                      HostnameVerifier hostnameVerifier, JedisClusterHostAndPortMap hostAndPortMap) {
  }

We should implement builder pattern to make it easy to build.

Same as JedisPool

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions