Kafka Connect DropHeaders SMT Usage Reference for Confluent Platform
The DropHeaders SMT (org.apache.kafka.connect.transforms.DropHeaders) removes one or more specified headers from each Apache Kafka® record.
Description
The DropHeaders SMT drops one or more headers from each record.
To insert a header into records, see InsertHeader SMT.
Properties
Name | Description | Type | Valid Values | Importance |
|---|---|---|---|---|
| One or more comma-separated header names to drop. Required. | list | non-empty list of unique header names | high |
Example
This example shows how to use DropHeaders to drop the headers named app.id and txn.id.
"transforms": "dropAppIdHeader",
"transforms.dropAppIdHeader.type": "org.apache.kafka.connect.transforms.DropHeaders",
"transforms.dropAppIdHeader.headers": "app.id,txn.id"
Before: Records include headers app.id and txn.id.
After: Records do not include headers app.id and txn.id.
Predicates
Configure transformations with predicates to ensure they only process records satisfying a particular condition. You can also use predicates in a transformation chain along with the Kafka Connect Filter (Kafka) SMT Usage Reference for Confluent Platform to conditionally filter specific records. For more information, refer to Predicates.