# Format Indicator

**In short:** A Format Indicator is a tag on each message that names its data format. It helps a message format cope with future change, and it is an alternative to giving every data type its own channel.

## Explanation

Senders and receivers must agree on how data looks. The Format Indicator pattern asks how a message's data format can be designed so it can accommodate future changes. The approach is to mark each message with its format.

**The alternative: one channel per type.** A Datatype Channel (see the article of that name) gives each data type its own channel. Receivers infer the type from the channel they read. Both patterns address the same problem: the receiver must know how to process the data it gets. Datatype Channel lists Format Indicator as a related pattern.

**Reading the tag.** A Content-Based Router (see Content-based Router) inspects message content and sends each message to the right recipient. With a format tag, the router reads the tag and forwards the message to a recipient that understands that format.

**Unknown formats.** Some messages make no sense to a receiver. These go to an Invalid Message Channel (see Invalid Message Channel). That channel is the place for messages whose format nobody recognizes.

**Where to put the tag: a Kafka case.** In Kafka, a schema ID has traditionally acted as the format identifier. It is a number placed as a prefix in the payload. This ties consumers to the wire format. Older consumers that do not expect the extra bytes can break.

The alternative is to carry the schema ID in Kafka headers. The payload stays unchanged. Producers and consumers no longer need to upgrade in lockstep, so the system evolves more easily.

## Example

An order system sends order messages. Version 1 of the format has no discount field. Version 2 adds one. Each message carries a tag such as "order, v1" or "order, v2". A router reads the tag. It sends v1 messages to the receivers that understand v1 and v2 messages to those that understand v2. A message with a tag nobody knows goes to an invalid message channel.

## Trade-offs

Where the tag lives matters. A tag inside the payload couples consumers to the wire format and can break older consumers. A tag in headers leaves the payload unchanged and avoids lockstep upgrades. Compared with one channel per type, a tag means the receiver side needs a router and a plan for unknown formats.

A router reads the format tag and sends each message to the matching receiver.

```mermaid
flowchart LR
  P[Producer] -->|message + format tag| C[Single channel]
  C --> R[Router reads tag]
  R -->|v1| A[Receiver for v1]
  R -->|v2| B[Receiver for v2]
  R -->|unknown| X[Invalid message channel]
```

## Checks

- The document states where the format identifier is carried (for example, payload prefix or header) and why.
- A router or other mechanism that reads the format identifier and sends messages to the right recipient is described.
- Messages with unknown or unprocessable formats have a defined destination, such as an invalid message channel.
- The choice between a format indicator and one channel per data type is explained.

## Related

- [Datatype Channel](https://arc.fuet.ch/concepts/integration/datatype-channel.md)
- [Content-based Router](https://arc.fuet.ch/concepts/integration/content-based-router.md)
- [Invalid Message Channel](https://arc.fuet.ch/concepts/integration/invalid-message-channel.md)
- [Message Translator](https://arc.fuet.ch/concepts/integration/message-translator.md)
- [Canonical Data Model](https://arc.fuet.ch/concepts/integration/canonical-data-model.md)
- [Message Channel](https://arc.fuet.ch/concepts/integration/message-channel.md)
- [Envelope Wrapper](https://arc.fuet.ch/concepts/integration/envelope-wrapper.md)
- [Dead Letter Channel](https://arc.fuet.ch/concepts/integration/dead-letter-channel.md)

## Sources

- [Format Indicator - Enterprise Integration Patterns](https://www.enterpriseintegrationpatterns.com/patterns/messaging/FormatIndicator.html) — enterpriseintegrationpatterns.com, accessed 2026-11-09
- [Datatype Channel - Enterprise Integration Patterns](https://www.enterpriseintegrationpatterns.com/patterns/messaging/DatatypeChannel.html) — enterpriseintegrationpatterns.com, accessed 2026-11-09
- [Content-Based Router - Enterprise Integration Patterns](https://www.enterpriseintegrationpatterns.com/patterns/messaging/ContentBasedRouter.html) — enterpriseintegrationpatterns.com, accessed 2026-11-09
- [Invalid Message Channel - Enterprise Integration Patterns](https://www.enterpriseintegrationpatterns.com/patterns/messaging/InvalidMessageChannel.html) — enterpriseintegrationpatterns.com, accessed 2026-11-09
- [Introducing Schema IDs in Kafka Headers for Smarter Data Governance | FR](https://www.confluent.io/fr-fr/blog/schema-id-kafka-headers-data-governance/) — confluent.io, accessed 2026-11-09
