Storing Message Keys
You can configure the Kafka Consumer and Kafka Multitopic Consumer originsKafka Multitopic Consumer origin to capture Kafka message keys and store them in records. Store message key values when you want to use them in the pipeline, write them to destinations, or pass them to Kafka to use as message keys. By default, the origins discard Kafka message keys.
Kafka origins can store message key values in the following locations:
- In a specified record field
- Store message key values in a specified field when you want to perform processing based on field values. When you store message key values in a field, you can access the values easily with expression-based and field-based stages, such as the Stream Selector or Field Replacer processors.
- In a specified record header attribute
- Store message key values in a specified record header attribute when you want to use the Kafka Producer to pass message key values to Kafka as Kafka message keys.
- In a specified record field and record header attribute
- Store message key values in both a specified record field and a specified record header attribute when you have multiple uses for message key values.