liveBook · Manning

EmbeddedKafkaBroker

As explained in Kafka for Architects

EmbeddedKafkaBroker is a Spring-Kafka test component that starts an in-memory Kafka broker for automated tests.

EmbeddedKafkaBroker is a Spring-Kafka test component that starts an in-memory Kafka broker for integration tests. It behaves like a broker without requiring a shared Kafka cluster or external infrastructure. section 10.3.2

EmbeddedKafkaBroker supports a focused integration-testing workflow:

  • Start the broker with the test and shut it down when the test completes. section 10.3.2
  • Keep application logic unchanged because broker substitution is handled through test configuration. section 10.3.2

ProfileService producer test

A test invokes ProfileService, which publishes a Kafka message to the in-memory broker. A test consumer reads the message and evaluates its content and metadata.

How Kafka for Architects covers it

How deep it goes
Explains lifecycle, producer and consumer flows, and configuration substitution, but stops short of implementation walkthroughs.
Examples
Uses ProfileService producer verification and Customer360Service consumer verification against an in-memory broker.
What it assumes
Assumes a Spring-based application and Kafka integration-testing goals, while avoiding dependence on a full external Kafka cluster.
What you can do after
Apply it via Spring-Kafka test configuration to verify Kafka message delivery and consumer processing without changing application logic.
How it connects
Connects Kafka integration testing with test consumers, producer and consumer components, test configuration, and Testcontainers.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kafka for Architects. The section links point to the parts of the book it draws on.