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:
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
FieldsModifier and TypeFieldDescriptionstatic final RoutingModeThe defaultRoutingModeto use when one is not explicitly definedstatic final RoutingStrategyThe defaultRoutingStrategyto use when one is not explicitly defined -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the definedRoutingModefor this client to use when connecting to cluster members.Returns the strategy for routing client connections to members whenRoutingMode.MULTI_MEMBERis configured.inthashCode()setRoutingMode(RoutingMode routingMode) Sets theRoutingModefor this client to use when connecting to cluster members.setRoutingMode(com.hazelcast.client.impl.connection.tcp.RoutingMode routingMode) Deprecated, for removal: This API element is subject to removal in a future version.setRoutingStrategy(RoutingStrategy routingStrategy) Sets the strategy for routing client connections to members whenRoutingMode.MULTI_MEMBERis configured.toString()
-
Field Details
-
DEFAULT_ROUTING_STRATEGY
The defaultRoutingStrategyto use when one is not explicitly defined -
DEFAULT_ROUTING_MODE
The defaultRoutingModeto use when one is not explicitly defined
-
-
Constructor Details
-
ClusterRoutingConfig
public ClusterRoutingConfig() -
ClusterRoutingConfig
-
-
Method Details
-
getRoutingMode
Returns the definedRoutingModefor this client to use when connecting to cluster members.- Returns:
- the configured
RoutingMode
-
setRoutingMode
@Deprecated(since="5.6", forRemoval=true) public ClusterRoutingConfig setRoutingMode(com.hazelcast.client.impl.connection.tcp.RoutingMode routingMode) Deprecated, for removal: This API element is subject to removal in a future version.usesetRoutingMode(RoutingMode)instead.Sets theRoutingModefor this client to use when connecting to cluster members.- Parameters:
routingMode- the legacyRoutingModeenumeration value to use- Returns:
- this configuration.
-
setRoutingMode
Sets theRoutingModefor this client to use when connecting to cluster members.- Parameters:
routingMode- theRoutingModeto use- Returns:
- this configuration.
-
getRoutingStrategy
Returns the strategy for routing client connections to members whenRoutingMode.MULTI_MEMBERis configured.- Returns:
- the configured strategy.
-
setRoutingStrategy
Sets the strategy for routing client connections to members whenRoutingMode.MULTI_MEMBERis configured.- Parameters:
routingStrategy- the strategy to set.- Returns:
- this configuration.
-
equals
-
hashCode
public int hashCode() -
toString
-
setRoutingMode(RoutingMode)instead.