Module brod_group_coordinator

Behaviours: gen_server.

Data Types

config()

config() = brod:group_config()

protocol_name()

protocol_name() = string()

Function Index

ack/5For group member to call to acknowledge a consumed message offset.
code_change/3
commit_offsets/1Force commit collected (acked) offsets immediately.
commit_offsets/2Force commit collected (acked) offsets plus the given extra offsets immediately.
handle_call/3
handle_cast/2
handle_info/2
init/1
start_link/6Start a kafka consumer group coordinator.
terminate/2
update_topics/2Update the list of topics the brod_group_coordinator follow which triggers a join group rebalance.

Function Details

ack/5

ack(Pid::pid(), GenerationId::integer(), Topic::brod:topic(), Partition::brod:partition(), Offset::brod:offset()) -> ok

For group member to call to acknowledge a consumed message offset.

code_change/3

code_change(OldVsn, State, Extra) -> any()

commit_offsets/1

commit_offsets(CoordinatorPid::pid()) -> ok | {error, any()}

Force commit collected (acked) offsets immediately.

commit_offsets/2

commit_offsets(CoordinatorPid::pid(), Offsets0::[{{brod:topic(), brod:partition()}, brod:offset()}]) -> ok | {error, any()}

Force commit collected (acked) offsets plus the given extra offsets immediately.

NOTE: lists:usort/1 is applied on the given extra offsets to commit, meaning if two or more offsets for the same topic-partition exist in the list, only the one closest the head of the list is kept

handle_call/3

handle_call(Call, From, State) -> any()

handle_cast/2

handle_cast(Cast, State) -> any()

handle_info/2

handle_info(Info, State) -> any()

init/1

init(X1) -> any()

start_link/6

start_link(Client::brod:client(), GroupId::brod:group_id(), Topics::[brod:topic()], Config::config(), CbModule::module(), MemberPid::pid()) -> {ok, pid()} | {error, any()}

Start a kafka consumer group coordinator.

Client: 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:

terminate/2

terminate(Reason, State) -> any()

update_topics/2

update_topics(CoordinatorPid::pid(), Topics::[brod:topic()]) -> ok

Update the list of topics the brod_group_coordinator follow which triggers a join group rebalance


Generated by EDoc