View Source brod_group_member behaviour (brod v3.17.0)
brod_group_member behaviour callbacks to allow a process to act as a group member without having to deal with Kafka group protocol details. A typical workflow:
1. Spawn a group coordinator by calling
2. Subscribe to partitions received in the assignments from
3. Receive messages from the assigned partitions (delivered by the partition workers (the pollers) implemented in
4. Unsubscribe from all previously subscribed partitions when
assignments_revoked/1 is called.
For group members that commit offsets to Kafka, do:
brod_group_coordinator:ack/5. to acknowledge successful consumption of the messages. Group coordinator will commit the acknowledged offsets at configured interval.
brod_group_coordinator:commit_offsets/2 to force an immediate offset commit if necessary.
For group members that manage offsets locally, do:1. Implement the
get_committed_offsets/2callback. This callback is evaluated every time when new assignments are received.
Link to this section Summary
Link to this section Callbacks
-callback assignments_revoked(pid()) -> ok.
-callback user_data(pid()) -> binary().