RackAffinityGroupBalancer makes a best effort to pair up consumers with partitions whose leader is in the same rack. This strategy can have performance benefits by minimizing round trip latency between the consumer and the broker. In environments where network traffic across racks incurs charges (
| 151 | // This balancer requires Kafka version 0.10.0.0+ or later. Earlier versions do |
| 152 | // not return the brokers' racks in the metadata request. |
| 153 | type RackAffinityGroupBalancer struct { |
| 154 | // Rack is the name of the rack where this consumer is running. It will be |
| 155 | // communicated to the consumer group leader via the UserData so that |
| 156 | // assignments can be made with affinity to the partition leader. |
| 157 | Rack string |
| 158 | } |
| 159 | |
| 160 | func (r RackAffinityGroupBalancer) ProtocolName() string { |
| 161 | return "rack-affinity" |
nothing calls this directly
no outgoing calls
no test coverage detected