franz/consumers

Types

pub type Ack
pub type AckOrCommit(ack_or_commit)
pub type Commit
pub type CommitedOffset {
  CommitedOffset(partition: Int, offset: Int)
}

Constructors

  • CommitedOffset(partition: Int, offset: Int)
pub type ConsumerConfig {
  BeginOffset(OffsetTime)
  MinBytes(Int)
  MaxBytes(Int)
  MaxWaitTime(Int)
  SleepTimeout(Int)
  PrefetchCount(Int)
  PrefetchBytes(Int)
  OffsetResetPolicy(OffsetResetPolicy)
  SizeStatWindow(Int)
  IsolationLevel(IsolationLevel)
  ShareLeaderConn(Bool)
}

Constructors

  • BeginOffset(OffsetTime)
  • MinBytes(Int)
  • MaxBytes(Int)
  • MaxWaitTime(Int)
  • SleepTimeout(Int)
  • PrefetchCount(Int)
  • PrefetchBytes(Int)
  • OffsetResetPolicy(OffsetResetPolicy)
  • SizeStatWindow(Int)
  • IsolationLevel(IsolationLevel)
  • ShareLeaderConn(Bool)
pub type ConsumerPartition {
  ConsumerPartitions(List(Int))
  All
}

Constructors

  • ConsumerPartitions(List(Int))
  • All
pub type GroupConfig {
  SessionTimeoutSeconds(Int)
  RebalanceTimeoutSeconds(Int)
  HeartbeatRateSeconds(Int)
  MaxRejoinAttempts(Int)
  RejoinDelaySeconds(Int)
  OffsetCommitIntervalSeconds(Int)
  OffsetRetentionSeconds(Int)
}

Constructors

  • SessionTimeoutSeconds(Int)
  • RebalanceTimeoutSeconds(Int)
  • HeartbeatRateSeconds(Int)
  • MaxRejoinAttempts(Int)
  • RejoinDelaySeconds(Int)
  • OffsetCommitIntervalSeconds(Int)
  • OffsetRetentionSeconds(Int)
pub type IsolationLevel {
  ReadCommitted
  ReadUncommitted
}

Constructors

  • ReadCommitted
  • ReadUncommitted
pub type MessageType {
  Message
  MessageSet
}

Constructors

  • Message
  • MessageSet
pub type OffsetResetPolicy {
  ResetBySubscriber
  ResetToEarliest
  ResetToLatest
}

Constructors

  • ResetBySubscriber
  • ResetToEarliest
  • ResetToLatest
pub type OffsetTime {
  Earliest
  Latest
  MessageTimestamp(Int)
}

Constructors

  • Earliest
  • Latest
  • MessageTimestamp(Int)

Functions

pub fn ack_return(cb_state: a) -> AckOrCommit(Ack)
pub fn commit_return(cb_state: a) -> AckOrCommit(Commit)
pub fn start_consumer(
  client: FranzClient,
  topic: String,
  options: List(ConsumerConfig),
) -> Result(Nil, FranzError)
pub fn start_group_subscriber(
  client: FranzClient,
  group_id: String,
  topics: List(String),
  consumer_config: List(ConsumerConfig),
  group_config: List(GroupConfig),
  message_type: MessageType,
  callback: fn(KafkaMessage, a) -> AckOrCommit(b),
  init_callback_state: a,
) -> Result(Pid, FranzError)
pub fn start_topic_subscriber(
  client: FranzClient,
  topic: String,
  partitions: ConsumerPartition,
  consumer_config: List(ConsumerConfig),
  commited_offsets: List(CommitedOffset),
  message_type: MessageType,
  callback: fn(Int, KafkaMessage, a) -> AckOrCommit(Ack),
  init_callback_state: a,
) -> Result(Pid, FranzError)
Search Document