This project contains common transformations with Kafka Connect.
For Docker image confluentinc/cp-kafka-connect-base:6.2.0 build jar and place it to directory /usr/share/java/kafka-serde-tools
Unwrap value from google.protobuf.StringValue(google/protobuf/wrappers.proto) struct. Another structs from wrappers.proto could be implemented additionally.
Key
ru.typik.kafka.connect.transform.UnwrapTransformation$Key
Value
ru.typik.kafka.connect.transform.UnwrapTransformation$Value
Input
Struct{
nullable=Struct{value=value},
simple=36773d6e-5ee4-4900-8d91-bd051a0896c7
}
Output
Struct{
nullable=value,
simple=36773d6e-5ee4-4900-8d91-bd051a0896c7
}
Input
Struct{
simple=9ed9f48f-63e0-427b-b795-30b69bbd6d55
}
Output
Struct{
simple=9ed9f48f-63e0-427b-b795-30b69bbd6d55
}
Validate value from 'source' field. Place the field's value to 'target.json' field if it's valid json. Place the field's value to 'target.raw' field if it's invalid json.
Key
ru.typik.kafka.connect.transform.JsonOrRawTransformation$Key
Value
ru.typik.kafka.connect.transform.JsonOrRawTransformation$Value
The field to verify is it correct json.
Importance: HIGH
Type: STRING
Validator: Matches: LOWER_HYPHEN, LOWER_UNDERSCORE, LOWER_CAMEL, UPPER_CAMEL, UPPER_UNDERSCORE
The field to place 'source' in case it is valid json
Importance: HIGH
Type: STRING
Validator: Matches: LOWER_HYPHEN, LOWER_UNDERSCORE, LOWER_CAMEL, UPPER_CAMEL, UPPER_UNDERSCORE
The field to place 'source' in case it is inValid json
Importance: HIGH
Type: STRING
Validator: Matches: LOWER_HYPHEN, LOWER_UNDERSCORE, LOWER_CAMEL, UPPER_CAMEL, UPPER_UNDERSCORE
{
...
"transforms.jsonOrRaw.source": "requestBody",
"transforms.jsonOrRaw.target.json": "requestBody",
"transforms.jsonOrRaw.target.raw": "rawBody",
...
}
Input
Struct{
value={ "a" : "b" },
other=other
}
Output
Struct{
json={ "a" : "b" },
other=other
}
Input
Struct{
value=asdf,
other=other
}
Output
Struct{
raw=asdf,
other=other
}