View Source KafkaEx.Messages.FindCoordinator (kafka_ex v1.0.0-rc.1)
This module represents FindCoordinator response from Kafka.
FindCoordinator is used to discover the coordinator broker for a consumer group or transactional producer.
Coordinator Types
0(:group) - Consumer group coordinator1(:transaction) - Transaction coordinator
API Version Differences
- V0: Uses
group_idparameter, returns coordinator info witherror_code - V1: Uses
coordinator_key+coordinator_type, addsthrottle_time_msanderror_message
Summary
Functions
Builds a FindCoordinator struct from response data.
Returns the node_id of the coordinator if successful, nil otherwise.
Converts a coordinator type atom to its integer value.
Converts an integer coordinator type to its atom representation.
Returns true if the response indicates success (no error).
Types
@type coordinator_type() :: :group | :transaction
@type t() :: %KafkaEx.Messages.FindCoordinator{ coordinator: KafkaEx.Cluster.Broker.t() | nil, error_code: atom(), error_message: binary() | nil, throttle_time_ms: non_neg_integer() | nil }
Functions
Builds a FindCoordinator struct from response data.
@spec coordinator_node_id(t()) :: non_neg_integer() | nil
Returns the node_id of the coordinator if successful, nil otherwise.
@spec coordinator_type_to_int(coordinator_type()) :: 0 | 1
Converts a coordinator type atom to its integer value.
@spec int_to_coordinator_type(0 | 1) :: coordinator_type()
Converts an integer coordinator type to its atom representation.
Returns true if the response indicates success (no error).