liveBook · Manning

HTTP header

As explained in Kafka for Architects

A message header is auxiliary metadata attached to a Kafka record independently of its key and value.

In a Kafka message, an optional header carries technical information alongside the key, value, and timestamp. The value holds application data; the key determines partition placement, which matters when related messages must remain in order. A header serves neither role. section 2.4.1 section 2.7

Identifying a producer

If several applications produce messages, an incorrectly formatted message may be hard to trace. Adding the producing application's identifier to a header gives operators a way to identify its source and assign responsibility. section 3.2.6

Set header conventions in producer services rather than expecting the broker to interpret them. Kafka clients serialize and deserialize message components; brokers do not apply application logic to headers. section 3.2.6 section 2.4.7

How Kafka for Architects covers it

How deep it goes
Defines headers by their place in a message and gives a producer-identification practice, but no header API or format.
Examples
Uses an incorrectly formatted message to motivate storing the producing application's identifier in a header.
What it assumes
Assumes familiarity with Kafka producers while distinguishing message keys, values, and headers.
What you can do after
Apply it via producer service code to label messages for source tracing and accountability.
How it connects
Distinguishes headers from message keys, values, and partitioning, and links them to producers and client-side serialization.

Also explained in

Compare how 4 books explain HTTP header →

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.