Package io.kroxylicious.proxy.config
Class PortIdentifiesNodeIdentificationStrategy
java.lang.Object
io.kroxylicious.proxy.config.PortIdentifiesNodeIdentificationStrategy
- All Implemented Interfaces:
NodeIdentificationStrategyFactory
public class PortIdentifiesNodeIdentificationStrategy
extends Object
implements NodeIdentificationStrategyFactory
A NodeIdentificationStrategy implementation that uses a separate port per broker endpoint and that is aware of
distinct ranges of nodeIds present in the target cluster. Upstream nodeIds are mapped to a compact set of ports.
The following configuration is supported:
The following configuration is supported:
bootstrapAddress(required) aHostPortdefining the host and port of the bootstrap address.brokerAddressPattern(optional) an address pattern used to form broker addresses. It is addresses made from this pattern that are returned to the kafka client in the Metadata response so must be resolvable by the client. One pattern is supported:$(nodeId)which interpolates the node id into the address. If brokerAddressPattern is omitted, it defaulted it based on the host name ofbootstrapAddress.brokerStartPort(optional) defines the starting range of port number that will be assigned to the brokers. If omitted, it is defaulted to the port number ofbootstrapAddress + 1.nodeIdRanges(required) defines the node id ranges present in the target cluster
-
Constructor Summary
ConstructorsConstructorDescriptionPortIdentifiesNodeIdentificationStrategy(HostPort bootstrapAddress, String advertisedBrokerAddressPattern, Integer nodeStartPort, List<NamedRange> nodeIdRanges) -
Method Summary
Modifier and TypeMethodDescriptionbuildStrategy(String clusterName) booleaninthashCode()toString()
-
Constructor Details
-
PortIdentifiesNodeIdentificationStrategy
public PortIdentifiesNodeIdentificationStrategy(HostPort bootstrapAddress, @Nullable String advertisedBrokerAddressPattern, @Nullable Integer nodeStartPort, @Nullable List<NamedRange> nodeIdRanges)
-
-
Method Details
-
getNodeStartPort
-
getNodeIdRanges
-
getAdvertisedBrokerAddressPattern
-
getBootstrapAddress
-
buildStrategy
- Specified by:
buildStrategyin interfaceNodeIdentificationStrategyFactory
-
equals
-
hashCode
public int hashCode() -
toString
-