File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ # Kafka Connect SMT to convert values to JSON strings
2+ This lib implements Kafka connect SMT (Single Message Transformation) to
3+ convert values of specified fields to JSON strings (stringify).
4+
5+ ## Config
6+ Use it in connector config file like this:
7+ ~~~ json
8+ ...
9+ "transforms" : " stringify" ,
10+ "transforms.stringify.type" : " com.github.maxprosper.smt.stringifyjson.StringifyJson$Value" ,
11+ "transforms.stringify.targetFields" : " field1,field2" ,
12+ ...
13+ ~~~
14+
15+ Use dot notation for deeper fields (e. g. ` level1.level2 ` ).
16+
17+ ## Install to Kafka Connect
18+ After build copy file ` target/stirngify-json-smt-0.0.0-jar-with-deps.jar `
19+ to Kafka Connect container `` copying to its docker image or so.
20+
21+ It can be done adding this line to Dockerfile:
22+ ~~~ Dockerfile
23+ COPY ./target/stringify-json-smt-0.0.0-jar-with-deps.jar $KAFKA_CONNECT_PLUGINS_DIR
24+ ~~~
25+
26+ Or download current release:
27+ ~~~ Dockerfile
28+ RUN curl -fSL -o /tmp/plugin.tar.gz \
29+ https://github.com/max-prosper/stringify-json-smt/releases/download/0.0.0/stringify-json-smt-0.0.0.tar.gz && \
30+ tar -xzf /tmp/plugin.tar.gz -C $KAFKA_CONNECT_PLUGINS_DIR && \
31+ rm -f /tmp/plugin.tar.gz;
32+ ~~~
33+
34+ ## Build release file
35+ - Increment version in ` pom.xml ` (e.g. to ` 0.0.1 ` ).
36+ - Run build script: ` ./scripts/build-release.sh 0.0.1 ` .
37+ - Take ` *.tar.gz ` file from ` target ` folder and publish it.
You can’t perform that action at this time.
0 commit comments