https://github.com/phpinnacle/toblerone
https://github.com/phpinnacle/toblerone
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/phpinnacle/toblerone
- Owner: phpinnacle
- License: apache-2.0
- Created: 2023-04-15T17:13:39.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-04-15T23:14:22.000Z (almost 2 years ago)
- Last Synced: 2025-09-09T13:01:31.771Z (5 months ago)
- Language: Kotlin
- Size: 77.1 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Kafka Connect Single Message Transforms
This is an implementation of the [Kafka Connect SMT](https://docs.confluent.io/platform/current/connect/transforms/overview.html) interface
to offer some widely used transformations
## Build
The library uses Gradle to build the JAR.
1. Install latest Java SDK.
2. Checkout the Git repository and change to its root folder.
3. Execute `./gradlew build`
The JAR can then be found in the `build/libs/` subfolder.
## Install
After the JAR was build as described above, copy it to your Kafka Connect instance into one of the directories listed in
the `plugin.path` property in the connect worker configuration file.
> Make sure to do this on all Kafka Connect worker nodes!
See the [Confluent Kafka Connect Plugins Userguide](https://docs.confluent.io/home/connect/self-managed/userguide.html#installing-kconnect-plugins) for more details.
## Example
### Connector Configuration
```json
{
"name": ...,
"config": {
...,
"transforms": "trim,substring,radix",
"transforms.trim.type": "org.phpinnacle.toblerone.TrimTransform$Value",
"transforms.trim.fields": "comma,separated,list,of,fields",
"transforms.substring.type": "org.phpinnacle.toblerone.SubstringTransform$Value",
"transforms.substring.fields": "foo:1:3,bar:2",
"transforms.radix.type": "org.phpinnacle.toblerone.RadixTransform$Value",
"transforms.radix.fields": "foo:16,bar:36"
}
}
```
> Note that the transformer only supports some kind of structured input. So make sure that there is a [converter](https://www.confluent.io/blog/kafka-connect-deep-dive-converters-serialization-explained/) class (e.g. [AvroConverter](https://www.confluent.io/hub/confluentinc/kafka-connect-avro-converter), [JsonConverter](https://www.confluent.io/hub/confluentinc/kafka-connect-json-schema-converter)) like `"value.converter": "io.confluent.connect.avro.AvroConverter"` that provides the data in a structured format.