franz/topic_subscriber

Types

pub type Ack
pub opaque type Builder(callback_init_state)

Values

pub fn ack(cb_state: cb_state) -> Ack

Acknowledge the processing of the message.

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

Create a new topic subscriber builder.

pub fn start(
  builder: Builder(callback_init_state),
) -> Result(process.Pid, franz.FranzError)

Start a new topic subscriber.

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

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(callback_init_state),
  consumer_config: consumer_config.ConsumerConfig,
) -> Builder(callback_init_state)

Add a consumer configuration to the topic subscriber builder.

Search Document