Package com.hazelcast.client.config
Class ClusterRoutingConfig
java.lang.Object
com.hazelcast.client.config.ClusterRoutingConfig
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 Summary
Modifier and TypeFieldDescriptionstatic final com.hazelcast.client.impl.connection.tcp.RoutingMode
The defaultRoutingMode
to use when one is not explicitly definedstatic final RoutingStrategy
The defaultRoutingStrategy
to use when one is not explicitly defined -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
com.hazelcast.client.impl.connection.tcp.RoutingMode
Returns the definedRoutingMode
for this client to use when connecting to cluster members.Returns the strategy for routing client connections to members whenRoutingMode.MULTI_MEMBER
is configured.int
hashCode()
setRoutingMode
(com.hazelcast.client.impl.connection.tcp.RoutingMode routingMode) Sets theRoutingMode
for this client to use when connecting to cluster members.setRoutingStrategy
(RoutingStrategy routingStrategy) Sets the strategy for routing client connections to members whenRoutingMode.MULTI_MEMBER
is configured.toString()
-
Field Details
-
DEFAULT_ROUTING_STRATEGY
The defaultRoutingStrategy
to use when one is not explicitly defined -
DEFAULT_ROUTING_MODE
public static final com.hazelcast.client.impl.connection.tcp.RoutingMode DEFAULT_ROUTING_MODEThe defaultRoutingMode
to use when one is not explicitly defined
-
-
Constructor Details
-
ClusterRoutingConfig
public ClusterRoutingConfig() -
ClusterRoutingConfig
-
-
Method Details
-
getRoutingMode
public com.hazelcast.client.impl.connection.tcp.RoutingMode getRoutingMode()Returns the definedRoutingMode
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 theRoutingMode
for this client to use when connecting to cluster members.- Parameters:
routingMode
- theRoutingMode
to use- Returns:
- this configuration.
-
getRoutingStrategy
Returns the strategy for routing client connections to members whenRoutingMode.MULTI_MEMBER
is configured.- Returns:
- the configured strategy.
-
setRoutingStrategy
Sets the strategy for routing client connections to members whenRoutingMode.MULTI_MEMBER
is configured.- Parameters:
routingStrategy
- the strategy to set.- Returns:
- this configuration.
-
equals
-
hashCode
public int hashCode() -
toString
-