I’m working on an application which utilizes Kafka as a message broker. I want to be able to test the application without having to have a Kafka broker online. How do I inject the Kafka code into my application such that I can replace it with an in-memory solution for my tests?
I have the interface boiled down to:
module type Broker : sig type client type message type ack val send_message : client -> string -> message -> ack Lwt.t val listen : client -> string array -> ack Lwt.t end