franz/topic_subscriber

Types

pub type Ack
pub opaque type Builder(callback_init_state)

Functions

pub fn ack(cb_state: a) -> Ack

Acknowledge the processing of the message.

pub fn new(
  client client: FranzClient,
  topic topic: String,
  partitions partitions: Partitions,
  message_type message_type: MessageType,
  callback callback: fn(Int, KafkaMessage, a) -> Ack,
  init_callback_state init_callback_state: a,
) -> Builder(a)

Create a new topic subscriber builder.

pub fn start(builder: Builder(a)) -> Result(Pid, FranzError)

Start a new topic subscriber.

pub fn with_commited_offset(
  builder: Builder(a),
  partition partition: Int,
  offset offset: Int,
) -> Builder(a)

Add a commited offset to the topic subscriber builder. CommittedOffsets are the offsets for the messages that have been successfully processed (acknowledged), not the begin-offset to start fetching from

pub fn with_config(
  builder: Builder(a),
  consumer_config: ConsumerConfig,
) -> Builder(a)

Add a consumer configuration to the topic subscriber builder.

Search Document