liveBook · Manning

ValueToKey

As explained in Kafka Streams in Action, Second Edition

ValueToKey is a Kafka Connect single message transform that copies a field from a record value into the record key.

ValueToKey is a Kafka Connect single message transform that copies a selected field from a record value into the record key. Configure it as JSON; no Java code is required. section 5.4

The copied field first becomes a single-field Struct in the key. Chain ExtractField$Key afterward when the connector needs the field value itself rather than the Struct. section 5.4

Build the transform chain in application order:

  • Name the transforms in the transforms property; their order controls how each transformation receives and changes the record. section 5.4

How Kafka Streams in Action, Second Edition covers it

How deep it goes
Explains JSON configuration, transform ordering, and the intermediate Struct, but defers custom transform implementation.
Examples
Uses user_name as the copied field, unwraps its Struct key, and masks ssn in the value.
What it assumes
Assumes a Kafka Connect connector and converter pipeline, while introducing built-in SMT configuration from JSON.
What you can do after
Operate/configure a Kafka Connect SMT chain that derives record keys from value fields using JSON.
How it connects
Connects ValueToKey with Kafka Connect SMTs, ExtractField, MaskField, connectors, converters, and Kafka records.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kafka Streams in Action, Second Edition. The section links point to the parts of the book it draws on.