Start a kafka consumer group coordinator.
ClientId (or pid, but not recommended)
GroupId: Predefined globally unique (in a kafka cluster) binary string.
Topics: Predefined set of topic names to join the group.
CbModule: The module which implements group coordinator callbacks
MemberPid: The member process pid.
Config: The group coordinator configs in a proplist, possible entries:
partition_assignment_strategy (optional, default =
Time in seconds for the group coordinator broker to consider a member 'down' if no heartbeat or any kind of requests received from a broker in the past N seconds. A group member may also consider the coordinator broker 'down' if no heartbeat response response received in the past N seconds.
session_timeout_seconds (optional, default = 30)
Time in seconds for each worker to join the group once a rebalance has begun. If the timeout is exceeded, then the worker will be removed from the group, which will cause offset commit failures.
rebalance_timeout_seconds (optional, default = 30)
Time in seconds for the member to 'ping' the group coordinator. OBS: Care should be taken when picking the number, on one hand, we do not want to flush the broker with requests if we set it too low, on the other hand, if set it too high, it may take too long for the members to realise status changes of the group such as assignment rebalacing or group coordinator switchover etc.
heartbeat_rate_seconds (optional, default = 5)
Maximum number of times allowed for a member to re-join the group. The gen_server will stop if it reached the maximum number of retries. OBS: 'let it crash' may not be the optimal strategy here because the group member id is kept in the gen_server looping state and it is reused when re-joining the group.
max_rejoin_attempts (optional, default = 5)
Delay in seconds before re-joining the group.
rejoin_delay_seconds (optional, default = 1)
How/where to commit offsets, possible values:
offset_commit_policy (optional, default =
commit_to_kafka_v2: Group coordinator will commit the offsets to kafka using version 2 OffsetCommitRequest.
consumer_managed: The group member (e.g. brod_group_subscriber.erl) is responsible for persisting offsets to a local or centralized storage. And the callback
get_committed_offsets should be implemented to allow group coordinator to retrieve the committed offsets.
The time interval between two OffsetCommitRequest messages. This config is irrelevant if
offset_commit_interval_seconds (optional, default = 5)
How long the time is to be kept in kafka before it is deleted. The default special value -1 indicates that the __consumer_offsets topic retention policy is used. This config is irrelevant if
offset_retention_seconds (optional, default = -1)
This is the protocol name used when join a group, if not given, by default
protocol_name (optional, default = roundrobin_v2)
partition_assignment_strategy is used as the protocol name. Setting a protocol name allows to interact with consumer group members designed in other programming languages. For example, 'range' is the most commonly used protocol name for JAVA client. However, brod only supports roundrobin protocol out of the box, in order to mimic 'range' protocol one will have to do it via
callback_implemented assignment strategy