liveBook · Manning

SmallRye Kafka connector

As explained in Quarkus in Action

The SmallRye Kafka connector is a Reactive Messaging connector that publishes and consumes messages through Apache Kafka.

SmallRye Kafka is a Reactive Messaging connector for connecting Quarkus applications to Apache Kafka. It lets services publish and consume messages through named channels, such as an invoice-adjustment stream between Rental and Billing services. section 9.6 section 9.6.1

A typical Quarkus integration proceeds as follows:

  • Add the Quarkus extension with `quarkus ext add quarkus-messaging-kafka`. section 9.6.1
  • Inject an emitter for a channel, such as `@Channel("invoices-adjust") Emitter<InvoiceAdjust>`, then send domain messages from application logic. section 9.6.1
  • Configure the channel with the `smallrye-kafka` connector so messages reach the Kafka topic. section 9.6.1
  • Configure an outgoing channel when publishing confirmations, using `mp.messaging.outgoing.invoices-confirmations.connector=smallrye-kafka`. section 9.8.3

Publishing an invoice adjustment

The Rental service creates an `InvoiceAdjust` message containing the rental ID, user ID, actual end date, and adjusted price. Its emitter publishes the message to `invoices-adjust`; the connector serializes the object and sends it to Kafka, where Billing can consume it. section 9.6.1 section 9.6.1

Figure 9.8 The car rental architecture diagram detailing the Billing service integration
figure

The architecture diagram shows the Rental and Billing service integration around the Kafka broker. section 9.6

How Quarkus in Action covers it

How deep it goes
Demonstrates extension installation, channel configuration, emitters, serialization, and local broker startup, but omits Kafka internals.
Examples
Uses Rental and Billing services, the invoices-adjust topic, InvoiceAdjust messages, and invoice-confirmations configuration.
What it assumes
Assumes a Quarkus application and Reactive Messaging context, while introducing Kafka connector setup from a simple service integration.
What you can do after
Builds a Quarkus service integration that publishes serialized domain messages to Kafka and connects services through shared channels.
How it connects
Links Reactive Messaging, Quarkus, Apache Kafka, Kafka topics, channels, emitters, Dev Services, and Redpanda.

Related concepts

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