Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env -S ocaml -w +A
- #use "topfind";;
- #load "unix.cma";;
- #thread;;
- #require "kafka";;
- #require "kafka_lwt";;
- open Lwt.Infix
- let () =
- Lwt_main.run begin
- let producer = Kafka.new_producer ["bootstrap.servers","localhost:9092"] in
- let producer_topic = Kafka.new_topic producer "fuck" [] in
- let partition = 0 in
- (* Produce some messages *)
- Kafka_lwt.produce producer_topic partition "message 0" >>= fun () ->
- Kafka_lwt.produce producer_topic partition "message 1" >>= fun () ->
- Kafka_lwt.produce producer_topic partition "message 2"
- end
Add Comment
Please, Sign In to add comment