Behaviours: gen_server.
This module defines the brod_topic_subscriber behaviour.
Required callback functions: init/2, handle_message/3.
cb_fun() = fun((brod:partition(), brod:message() | brod:message_set(), cb_state()) -> cb_ret())
cb_ret() = {ok, cb_state()} | {ok, ack, cb_state()}
cb_state() = term()
committed_offsets() = [{brod:partition(), brod:offset()}]
ack/3 | Acknowledge that message has been sucessfully consumed. |
start_link/6 | Equivalent to start_link(Client, Topic, Partitions, ConsumerConfig, message, CbModule, CbInitArg). |
start_link/7 | Start (link) a topic subscriber which receives and processes the messages or message sets from the given partition set. |
start_link/8 | Start (link) a topic subscriber which receives and processes the messages from the given partition set. |
stop/1 | Stop topic subscriber. |
ack(Pid::pid(), Partition::brod:partition(), Offset::brod:offset()) -> ok
Acknowledge that message has been sucessfully consumed.
start_link(Client::brod:client(), Topic::brod:topic(), Partitions::all | [brod:partition()], ConsumerConfig::brod:consumer_config(), CbModule::module(), CbInitArg::term()) -> {ok, pid()} | {error, any()}
Equivalent to start_link(Client, Topic, Partitions, ConsumerConfig, message, CbModule, CbInitArg).
start_link(Client::brod:client(), Topic::brod:topic(), Partitions::all | [brod:partition()], ConsumerConfig::brod:consumer_config(), MessageType::message | message_set, CbModule::module(), CbInitArg::term()) -> {ok, pid()} | {error, any()}
Start (link) a topic subscriber which receives and processes the
messages or message sets from the given partition set. Use atom all
to subscribe to all partitions. Messages are handled by calling
CbModule:handle_message
start_link(Client::brod:client(), Topic::brod:topic(), Partitions::all | [brod:partition()], ConsumerConfig::brod:consumer_config(), CommittedOffsets::committed_offsets(), MessageType::message | message_set, CbFun::cb_fun(), CbInitialState::cb_state()) -> {ok, pid()} | {error, any()}
Start (link) a topic subscriber which receives and processes the
messages from the given partition set. Use atom all
to subscribe to all
partitions. Messages are handled by calling the callback function.
CommittedOffsets
are the offsets for the messages that have
been successfully processed (acknowledged), not the begin-offset
to start fetching from.
stop(Pid::pid()) -> ok
Stop topic subscriber.
Generated by EDoc