liveBook · Manning

Event

As explained in Apache Kafka in Action

An event is a record representing a significant occurrence, change, activity, transaction, or incident and its associated information.

An event records a significant occurrence, change, activity, transaction, or incident together with information about what happened. In an enterprise, user interactions, system updates, and financial transactions can become structured events published to Kafka topics for other systems to consume and process asynchronously. section 1.2

Use events as self-contained messages that carry context about business activity.

  • Publish events to Kafka topics, where subscribing applications can consume and process them in real time. section 1.2
  • Distinguish events from states, deltas, and commands: events describe business activity that happened, while commands instruct systems to act. section 3.3
  • Keep each Kafka message semantically self-contained; split a large message containing many events into one message per event. section 18.5.3
  • Send machine-readable event data through Kafka rather than exchanging large files; store files elsewhere and publish a notification containing their address. section 18.5.3

From uploaded PDF to event notification

Store the PDF in object storage, then publish an event through Kafka indicating that the file was uploaded or changed and identifying its address. A consumer retrieves the file after receiving the notification. section 18.5.3

Figure 1.1 Kafka as the central nervous system for data in a company. Every event that takes place in the enterprise is stored in Kafka. Other services can react to these events asynchronously and process them further.
A screenshot of a computer

AI-generated content may be incorrect.

Visualizes Kafka as an enterprise data nervous system in which services react asynchronously to stored events. section 1.2

Figure 18.9 Don’t use Kafka to exchange files between systems. Use, for example, an object storage solution instead, and then use Kafka to notify others about the file that was uploaded or changed.
A diagram of different types of files

AI-generated content may be incorrect.

Contrasts Kafka event notifications with inappropriate file exchange and shows object storage as the file location. section 18.5.3

How Apache Kafka in Action covers it

How deep it goes
Defines events, distinguishes them from message types, and explains self-contained sizing without detailing event schemas or processing code.
Examples
Uses user interactions, system updates, financial transactions, uploaded PDFs, and semantically split SOAP messages as examples.
What you can do after
Apply event modeling by publishing self-contained business occurrences to Kafka and notifying consumers about externally stored files.
How it connects
Links events to Kafka topics, event-driven architectures, messages, schemas, partitions, consumers, legacy systems, and object storage.

Also explained in

Compare how 18 books explain event →

Related concepts

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