Module Kafka

type handler
type topic
type queue
type partition = int
type offset = int64
type message =
| Message of topic * partition * offset * string * string option
| PartitionEnd of topic * partition * offset
type msg_id = int
type error =
| BAD_MSG
| BAD_COMPRESSION
| DESTROY
| FAIL
| TRANSPORT
| CRIT_SYS_RESOURCE
| RESOLVE
| MSG_TIMED_OUT
| UNKNOWN_PARTITION
| FS
| UNKNOWN_TOPIC
| ALL_BROKERS_DOWN
| INVALID_ARG
| TIMED_OUT
| QUEUE_FULL
| ISR_INSUFF
| UNKNOWN
| OFFSET_OUT_OF_RANGE
| INVALID_MSG
| UNKNOWN_TOPIC_OR_PART
| INVALID_MSG_SIZE
| LEADER_NOT_AVAILABLE
| NOT_LEADER_FOR_PARTITION
| REQUEST_TIMED_OUT
| BROKER_NOT_AVAILABLE
| REPLICA_NOT_AVAILABLE
| MSG_SIZE_TOO_LARGE
| STALE_CTRL_EPOCH
| OFFSET_METADATA_TOO_LARGE
| CONF_UNKNOWN
| CONF_INVALID
exception Error of error * string
val new_consumer : (string * string) list -> handler
val new_producer : ?⁠delivery_callback:(msg_id -> error option -> unit) -> (string * string) list -> handler
val destroy_handler : handler -> unit
val handler_name : handler -> string
val new_topic : ?⁠partitioner_callback:(int -> string -> partition) -> handler -> string -> (string * string) list -> topic
val destroy_topic : topic -> unit
val topic_name : topic -> string
val produce : topic -> partition -> ?⁠key:string -> ?⁠msg_id:msg_id -> string -> unit
val partition_unassigned : partition
val outq_len : handler -> int
val poll_events : ?⁠timeout_ms:int -> handler -> int
val wait_delivery : ?⁠timeout_ms:int -> ?⁠max_outq_len:int -> handler -> unit

Wait that messages are delivered (waiting that less than max_outq_len messages are pending).

val consume_start : topic -> partition -> offset -> unit
val offset_beginning : offset
val offset_end : offset
val offset_stored : offset
val offset_tail : int -> offset
val consume_stop : topic -> partition -> unit
val consume : ?⁠timeout_ms:int -> topic -> partition -> message
val consume_batch : ?⁠timeout_ms:int -> ?⁠msg_count:int -> topic -> partition -> message list
val new_queue : handler -> queue
val destroy_queue : queue -> unit
val consume_start_queue : queue -> topic -> partition -> offset -> unit
val consume_queue : ?⁠timeout_ms:int -> queue -> message
val consume_batch_queue : ?⁠timeout_ms:int -> ?⁠msg_count:int -> queue -> message list
val store_offset : topic -> partition -> offset -> unit
module Metadata : sig ... end
val topic_metadata : ?⁠timeout_ms:int -> handler -> topic -> Metadata.topic_metadata
val local_topics_metadata : ?⁠timeout_ms:int -> handler -> Metadata.topic_metadata list
val all_topics_metadata : ?⁠timeout_ms:int -> handler -> Metadata.topic_metadata list