View Source KafkaEx.Consumer.ConsumerGroup.Heartbeat (kafka_ex v1.0.0-rc.1)

GenServer to send heartbeats to the broker

A HeartbeatRequest is sent periodically by each active group member (after completing the join/sync phase) to inform the broker that the member is still alive and participating in the group. If a group member fails to send a heartbeat before the group's session timeout expires, the coordinator removes that member from the group and initiates a rebalance.

HeartbeatResponse allows the coordinating broker to communicate the group's status to each member:

  • :no_error indicates that the group is up to date and no action is needed.
  • :rebalance_in_progress a rebalance has been initiated, so each member should re-join.
  • :unknown_member_id means that this heartbeat was from a previous dead generation.

For either of the error conditions, the heartbeat process exits, which is trapped by the KafkaEx.Consumer.ConsumerGroup.Manager and handled by re-joining the consumer group. (see KafkaEx.Consumer.ConsumerGroup.Manager.join/1)

Summary

Functions

Returns a specification to start this module under a supervisor.

Callback implementation for GenServer.init/1.

Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Callback implementation for GenServer.init/1.