package kafka

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type handler
type topic
type queue
type partition = int
type offset = int64
type message =
  1. | Message of topic * partition * offset * string * string option
  2. | PartitionEnd of topic * partition * offset
type msg_id = int
type error =
  1. | BAD_MSG
  2. | BAD_COMPRESSION
  3. | DESTROY
  4. | FAIL
  5. | TRANSPORT
  6. | CRIT_SYS_RESOURCE
  7. | RESOLVE
  8. | MSG_TIMED_OUT
  9. | UNKNOWN_PARTITION
  10. | FS
  11. | UNKNOWN_TOPIC
  12. | ALL_BROKERS_DOWN
  13. | INVALID_ARG
  14. | TIMED_OUT
  15. | QUEUE_FULL
  16. | ISR_INSUFF
  17. | UNKNOWN
  18. | OFFSET_OUT_OF_RANGE
  19. | INVALID_MSG
  20. | UNKNOWN_TOPIC_OR_PART
  21. | INVALID_MSG_SIZE
  22. | LEADER_NOT_AVAILABLE
  23. | NOT_LEADER_FOR_PARTITION
  24. | REQUEST_TIMED_OUT
  25. | BROKER_NOT_AVAILABLE
  26. | REPLICA_NOT_AVAILABLE
  27. | MSG_SIZE_TOO_LARGE
  28. | STALE_CTRL_EPOCH
  29. | OFFSET_METADATA_TOO_LARGE
  30. | CONF_UNKNOWN
  31. | 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
OCaml

Innovation. Community. Security.