Interface ConnectionSettings.Affinity<T>
- Type Parameters:
T- type of the owning object
- Enclosing interface:
ConnectionSettings<T>
public static interface ConnectionSettings.Affinity<T>
Connection affinity settings.
This is an experimental API, subject to change.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumAffinity operation. -
Method Summary
Modifier and TypeMethodDescriptionReturn the connection builder.operation(ConnectionSettings.Affinity.Operation operation) The type of operation to look affinity with.The queue to have affinity with.reuse(boolean reuse) Whether an open connection with the same affinity should reused.strategy(ConnectionSettings.AffinityStrategy strategy) Set theConnectionSettings.AffinityStrategy.
-
Method Details
-
queue
The queue to have affinity with.- Parameters:
queue- queue- Returns:
- affinity settings
-
operation
The type of operation to look affinity with.ConnectionSettings.Affinity.Operation.PUBLISHwill favor the node with the queue leader on it.ConnectionSettings.Affinity.Operation.CONSUMEwill favor a node with a queue member (replica) on it.- Parameters:
operation- type of operation- Returns:
- affinity settings
-
reuse
Whether an open connection with the same affinity should reused.Default is
false(open a new connection, do not reuse).- Parameters:
reuse- true to reuse, false to open a new connection- Returns:
- affinity settings
-
strategy
Set theConnectionSettings.AffinityStrategy.- Parameters:
strategy- affinity strategy- Returns:
- affinity settings
-
connection
-