liveBook · Manning

Producer

As explained in Contract Testing in Action

An event producer is a service or application that creates and publishes events for consumption by other components.

An event producer is a service or application that creates and publishes events for other components to consume. In contract testing, the producer corresponds to the provider, while the subscriber corresponds to the consumer. section 3.8.2 section 8.1

A producer implementation typically separates message creation from broker-specific delivery:

  • Configure the broker connection with a unique client ID and broker list. section 8.6
  • Construct the event body independently of Kafka or another messaging protocol. section 3.8.2
  • Send a keyed message containing the serialized event to the target topic. section 8.6
  • Verify the produced message against the consumer’s contract before deployment. section 3.8.2

Movie event producer

A web or mobile client requests a new movie. The producer creates a message containing the movie name and release year, then publishes it to Kafka’s “movies” topic. A subscribed backend service consumes the message and adds the movie to its database. A contract test checks that the message contains the expected content. section 8.1 section 8.6

Figure 8.2 Event-driven architecture communicates via the Kafka message broker passing the message for CDCT from the producer via the “movies” topic to the subscriber.
figure

Trace the producer-to-topic-to-subscriber flow and see how contract-testing terminology reverses the event flow through the Pact Broker. section 8.1

How Contract Testing in Action covers it

How deep it goes
Explains broker configuration, message construction, topic delivery, abstraction, and contract verification, without detailing broker internals.
Examples
Uses a movie service that publishes name and release-date data to Kafka’s “movies” topic for a backend subscriber.
What it assumes
Assumes event-driven messaging and contract-testing fundamentals while teaching message abstraction and producer workflow through a service example.
What you can do after
Operate/configure a Kafka producer, publish an event, and verify its message body against a consumer contract.
How it connects
Connects event producers with event consumers, message brokers, event-driven architecture, and consumer-driven contract testing.

Also explained in

Compare how 8 books explain producer →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Contract Testing in Action. The section links point to the parts of the book it draws on.