Apache Kafka — Event Streaming from Basics to a Platform Service›The ecosystem · Cheat sheet & self-check

The ecosystem · wrap-up

Cheat sheet & self-check

Every command from this section on one page.

11 · Schemas and Schema Registry

Compatibility modes

BACKWARD (default)New schema can read data written with the previous one: upgrade consumers first
FORWARDOld schema can read data written with the new one: upgrade producers first
FULLBoth directions: upgrade in any order
*_TRANSITIVECheck against all previous versions, not just the last
NONENo checks: avoid for shared topics

Safe changes (Avro, BACKWARD)

Add a field with a defaultSafe
Remove a fieldSafe for BACKWARD (readers ignore it); breaks FORWARD unless it had a default
Rename a fieldBreaking (use an alias, or add new + deprecate old)
Change a field's typeBreaking, except a few widening promotions such as int → long

Registry API

GET /subjectsList subjects
GET /subjects/orders-value/versions/latestLatest schema for the orders value
POST /compatibility/subjects/orders-value/versions/latestTest a new schema before registering
PUT /config/orders-value {"compatibility":"FULL"}Set the mode for one subject

12 · Kafka Connect, CDC and stream processing

Kafka Connect REST API (port 8083)

GET /connector-pluginsInstalled connector types
POST /connectors (JSON config)Create a connector
GET /connectors/<name>/statusConnector and task state (RUNNING, FAILED)
POST /connectors/<name>/restart?includeTasks=true&onlyFailed=trueRestart failed tasks
PUT /connectors/<name>/pausePause a connector

Useful connector settings

tasks.maxParallelism for this connector
errors.tolerance=allDon't stop on a bad record…
errors.deadletterqueue.topic.name=<topic>…send it here instead (sink connectors)
transforms=…Single message transforms: rename, mask, route

Choosing a processor

Kafka StreamsA Java library inside your service; Kafka in, Kafka out
Apache FlinkA separate cluster; large state, many sources, SQL, event time
Plain consumerSimple per-record logic