View Source KafkaEx.Protocol.Kayrock.FindCoordinator.RequestHelpers (kafka_ex v1.0.0-rc.1)
Shared utility functions for building FindCoordinator requests.
Summary
Functions
Builds a V1+ request by extracting coordinator key and type from options.
Extracts and normalizes coordinator type from options.
Extracts the group_id from options for V0 requests.
Extracts coordinator key and type from options for V1 requests.
Functions
Builds a V1+ request by extracting coordinator key and type from options.
Works for V1, V2, V3, and any future version with key + key_type fields.
@spec extract_coordinator_type(Keyword.t()) :: 0 | 1
Extracts and normalizes coordinator type from options.
Accepts:
- Integer: 0 or 1
- Atom: :group or :transaction
Returns integer (0 or 1).
Extracts the group_id from options for V0 requests.
Extracts coordinator key and type from options for V1 requests.
Returns {coordinator_key, coordinator_type} where:
coordinator_keyis the group_id or transactional_idcoordinator_typeis 0 (group) or 1 (transaction)