Use the Kafka Connect HeaderFrom SMT to promote record value fields into message headers before sink delivery

domain: kafka.apache.org · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Add a transforms entry to the connector config: transforms=promoteHeaders
  2. Set transforms.promoteHeaders.type=org.apache.kafka.connect.transforms.HeaderFrom$Value to operate on the record value
  3. Specify which fields to promote: transforms.promoteHeaders.fields=region,tenant_id and the corresponding header names: transforms.promoteHeaders.headers=x-region,x-tenant
  4. Choose operation mode: transforms.promoteHeaders.operation=copy to leave fields in the value, or move to remove them from the value after promotion
  5. Chain with a downstream SMT if needed: e.g. add a ReplaceField transform after HeaderFrom to drop any fields that should not appear in the sink payload
  6. Validate by consuming a transformed message with kafka-console-consumer.sh --print-headers and confirming x-region and x-tenant headers are present

Known gotchas

Related routes

Configure Kafka Connect with a custom SMT to mask or hash PII fields before records reach a sink connector
kafka.apache.org · 5 steps · unrated
Apply Kafka Connect Single Message Transforms for topic routing and field masking
kafka.apache.org · 6 steps · unrated
Apply Kafka Connect Single Message Transforms for field renaming, value filtering, and topic routing in a Debezium pipeline
debezium.io · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans