Integration Tests with Kafka

Hello, everyone!

I’ve started learning for a technical interview involving the use of an API to send messages to a Kafka Cluster.

I’ve observed a limited number of examples for using Kafka with Elixir. Perhaps I should consider using umbrella projects? However, my main question is: How can I perform integration tests with a Kafka mock server to send and consume messages?

In other languages, for instance, I would use test-containers, but in Elixir, I’m uncertain about the equivalent approach.

I apologize if my questions seem straightforward; I’m relatively new to learning Elixir.

Thank you!

There is exactly zero problem bringing up a container for integration tests in Elixir as well, there’s nothing special about it, it’s still Docker + Compose in the end. :smiley:

As for Kafka, I believe Overview — brod v3.17.0 is the accepted way of doing it. It also has integration with GitHub - dashbitco/broadway: Concurrent and multi-stage data ingestion and data processing with Elixir.

1 Like

There is a testcontainers implementation for elixir Testcontainers - A Testcontainers implementation for Elixir

1 Like