franz
Types
pub type ClientConfig {
RestartDelaySeconds(Int)
GetMetadataTimeoutSeconds(Int)
ReconnectCoolDownSeconds(Int)
AllowTopicAutoCreation(Bool)
AutoStartProducers(Bool)
DefaultProducerConfig(List(ProducerConfig))
UnknownTopicCacheTtl(Int)
}
Constructors
-
RestartDelaySeconds(Int)
-
GetMetadataTimeoutSeconds(Int)
-
ReconnectCoolDownSeconds(Int)
-
AllowTopicAutoCreation(Bool)
-
AutoStartProducers(Bool)
-
DefaultProducerConfig(List(ProducerConfig))
-
UnknownTopicCacheTtl(Int)
pub type Compression {
NoCompression
Gzip
Snappy
}
Constructors
-
NoCompression
-
Gzip
-
Snappy
pub type FranzClient
pub type FranzError {
UnknownError
ClientDown
UnknownTopicOrPartition
ProducerDown
TopicAlreadyExists
ConsumerNotFound(String)
ProducerNotFound(String, Int)
}
Constructors
-
UnknownError
-
ClientDown
-
UnknownTopicOrPartition
-
ProducerDown
-
TopicAlreadyExists
-
ConsumerNotFound(String)
-
ProducerNotFound(String, Int)
pub type KafkaMessage {
KafkaMessage(
offset: Int,
key: BitArray,
value: BitArray,
timestamp_type: TimeStampType,
timestamp: Int,
headers: List(#(String, String)),
)
KafkaMessageSet(
topic: Topic,
partition: Int,
high_wm_offset: Int,
messages: List(KafkaMessage),
)
}
Constructors
-
KafkaMessage( offset: Int, key: BitArray, value: BitArray, timestamp_type: TimeStampType, timestamp: Int, headers: List(#(String, String)), )
-
KafkaMessageSet( topic: Topic, partition: Int, high_wm_offset: Int, messages: List(KafkaMessage), )
pub type ProducerConfig {
RequiredAcks(Int)
AckTimeout(Int)
PartitionBufferLimit(Int)
PartitionOnwireLimit(Int)
MaxBatchSize(Int)
MaxRetries(Int)
RetryBackoffMs(Int)
Compression(Compression)
MaxLingerMs(Int)
MaxLingerCount(Int)
}
Constructors
-
RequiredAcks(Int)
-
AckTimeout(Int)
-
PartitionBufferLimit(Int)
-
PartitionOnwireLimit(Int)
-
MaxBatchSize(Int)
-
MaxRetries(Int)
-
RetryBackoffMs(Int)
-
Compression(Compression)
-
MaxLingerMs(Int)
-
MaxLingerCount(Int)
pub type TimeStampType {
Undefined
Create
Append
}
Constructors
-
Undefined
-
Create
-
Append
Functions
pub fn create_topic(
bootstrap_endpoints: List(#(String, Int)),
topic: String,
partitions: Int,
replication_factor: Int,
) -> Result(Nil, FranzError)
pub fn fetch(
client: FranzClient,
topic: String,
partition: Int,
offset: Int,
) -> Result(#(Int, KafkaMessage), FranzError)
pub fn start_client(
bootstrap_endpoints: List(#(String, Int)),
client_config: List(ClientConfig),
) -> Result(FranzClient, FranzError)
pub fn stop_client(client: FranzClient) -> Nil