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
=
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