Apply Kafka Connect Single Message Transforms for topic routing and field masking

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 list to the connector configuration, naming each transform step (e.g., transforms=routeByRegion,maskPII).
  2. For dynamic topic routing, use the RegexRouter or TimestampRouter built-in SMTs: specify transforms.routeByRegion.type=org.apache.kafka.connect.transforms.RegexRouter and supply a regex and replacement pattern that rewrite the destination topic name based on the record's original topic.
  3. For field masking, use MaskField$Value with a fields list of sensitive column names; the transform replaces field values with a type-appropriate zero value (empty string, 0, null) without removing the field from the schema.
  4. To drop a field entirely, use ReplaceField$Value with an exclude list instead.
  5. For conditional routing based on a record field value, chain a Filter SMT (Kafka Connect 2.6+) with a predicate, or use a custom SMT class placed on the Connect worker classpath.
  6. Validate the transform chain by running the connector in a test environment and inspecting output topics with a consumer before promoting.

Known gotchas

Related routes

Apply Kafka Connect Single Message Transforms for field renaming, value filtering, and topic routing in a Debezium pipeline
debezium.io · 5 steps · unrated
Use the Kafka Connect HeaderFrom SMT to promote record value fields into message headers before sink delivery
kafka.apache.org · 6 steps · unrated
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

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