Class ClusterRoutingConfig

java.lang.Object
com.hazelcast.client.config.ClusterRoutingConfig

public class ClusterRoutingConfig extends Object
Config for client routing and associated options. The overall approach to routing used by the client is defined by the RoutingMode, with three modes available:
  • RoutingMode.SINGLE_MEMBER
  • RoutingMode.MULTI_MEMBER
  • RoutingMode.ALL_MEMBERS

Special notes for RoutingMode.MULTI_MEMBER routing This feature requires the cluster members to be Enterprise nodes. If the cluster is not licensed appropriately, the client will not be able to connect to the cluster, failing with an UnsupportedRoutingModeException The minimum cluster version required for this feature is 5.5. If the cluster version is less than 5.5, the client will not be able to connect to the cluster, failing with an UnsupportedClusterVersionException

Since:
5.5
  • Field Details

    • DEFAULT_ROUTING_STRATEGY

      public static final RoutingStrategy DEFAULT_ROUTING_STRATEGY
      The default RoutingStrategy to use when one is not explicitly defined
    • DEFAULT_ROUTING_MODE

      public static final com.hazelcast.client.impl.connection.tcp.RoutingMode DEFAULT_ROUTING_MODE
      The default RoutingMode to use when one is not explicitly defined
  • Constructor Details

    • ClusterRoutingConfig

      public ClusterRoutingConfig()
    • ClusterRoutingConfig

      public ClusterRoutingConfig(ClusterRoutingConfig clusterRoutingConfig)
  • Method Details

    • getRoutingMode

      public com.hazelcast.client.impl.connection.tcp.RoutingMode getRoutingMode()
      Returns the defined RoutingMode for this client to use when connecting to cluster members.
      Returns:
      the configured RoutingMode
    • setRoutingMode

      public ClusterRoutingConfig setRoutingMode(com.hazelcast.client.impl.connection.tcp.RoutingMode routingMode)
      Sets the RoutingMode for this client to use when connecting to cluster members.
      Parameters:
      routingMode - the RoutingMode to use
      Returns:
      this configuration.
    • getRoutingStrategy

      public RoutingStrategy getRoutingStrategy()
      Returns the strategy for routing client connections to members when RoutingMode.MULTI_MEMBER is configured.
      Returns:
      the configured strategy.
    • setRoutingStrategy

      public ClusterRoutingConfig setRoutingStrategy(RoutingStrategy routingStrategy)
      Sets the strategy for routing client connections to members when RoutingMode.MULTI_MEMBER is configured.
      Parameters:
      routingStrategy - the strategy to set.
      Returns:
      this configuration.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object