Behaviours: brod_group_member, gen_server.
group_id() = brod:group_id()
group_input() = [{prop_key(), prop_val()}]
member_id() = brod:group_member_id()
offset() = brod:offset()
offsets() = latest | earliest | [{partition(), offset()}]
partition() = brod:partition()
prop_key() = id | topic | retention | protocol | offsets
prop_val() = group_id() | topic() | retention() | offsets() | brod_group_coordinator:protocol_name()
retention() = integer()
-1 to use whatever configured in kafka
topic() = brod:topic()
assign_partitions/3 | This function is called only when partition_assignment_strategy
is set for callback_implemented in group config. |
assignments_received/4 | Called by group coordinator when there is new assignemnt received. |
assignments_revoked/1 | Called by group coordinator before re-joinning the consumer group. |
code_change/3 | |
get_committed_offsets/2 | Called by group coordinator when initializing the assignments for subscriber. |
handle_call/3 | |
handle_cast/2 | |
handle_info/2 | |
init/1 | |
run/2 | Force commit offsets. |
start_link/2 | Start (link) a group member. |
stop/1 | Stop the process. |
sync/1 | Make a call to the resetter process, the call will be blocked until offsets are committed. |
terminate/2 |
assign_partitions(Pid::pid(), Members::[brod:group_member()], TopicPartitionList::[{brod:topic(), brod:partition()}]) -> [{member_id(), [brod:partition_assignment()]}]
This function is called only when partition_assignment_strategy
is set for callback_implemented
in group config.
assignments_received(Pid::pid(), MemberId::member_id(), GenerationId::integer(), TopicAssignments::brod:received_assignments()) -> ok
Called by group coordinator when there is new assignemnt received.
assignments_revoked(Pid::pid()) -> ok
Called by group coordinator before re-joinning the consumer group.
code_change(OldVsn, State, Extra) -> any()
get_committed_offsets(Pid::pid(), TopicPartitions::[{brod:topic(), brod:partition()}]) -> {ok, [{{brod:topic(), brod:partition()}, brod:offset()}]}
Called by group coordinator when initializing the assignments for subscriber. NOTE: this function is called only when it is DISABLED to commit offsets to kafka. i.e. offset_commit_policy is set to consumer_managed
handle_call(Call, From, State0) -> any()
handle_cast(Cast, State) -> any()
handle_info(Info, State) -> any()
init(X1) -> any()
run(ClientId, GroupInput) -> any()
Force commit offsets.
start_link(Client::brod:client(), GroupInput::group_input()) -> {ok, pid()} | {error, any()}
Start (link) a group member. The member will try to join the consumer group and get assignments for the given topic-partitions, then commit given offsets to kafka. In case not all given partitions are assigned to it, it will terminate with an exit exception
stop(Pid::pid()) -> ok
Stop the process.
sync(Pid::pid()) -> ok
Make a call to the resetter process, the call will be blocked until offsets are committed.
terminate(Reason, State) -> any()
Generated by EDoc