-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5918 from confluentinc/16092024-2
16092024 2 (#9)
- Loading branch information
Showing
9 changed files
with
117 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# kafka-connect-jsonata SMT | ||
|
||
|
||
|
||
## Objective | ||
|
||
Quickly test [kafka-connect-jsonata](https://github.com/rayokota/kafka-connect-jsonata) SMT. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
services: | ||
connect: | ||
environment: | ||
CONNECT_PLUGIN_PATH: /usr/share/filestream-connectors,/usr/share/confluent-hub-components/rayokota-kafka-connect-jsonata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" | ||
source ${DIR}/../../scripts/utils.sh | ||
|
||
PLAYGROUND_ENVIRONMENT=${PLAYGROUND_ENVIRONMENT:-"plaintext"} | ||
playground start-environment --environment "${PLAYGROUND_ENVIRONMENT}" --docker-compose-override-file "${PWD}/docker-compose.plaintext.yml" | ||
|
||
log "Sending messages to topic filestream" | ||
playground topic produce -t filestream --nb-messages 5 --key 1 << 'EOF' | ||
{ | ||
"fields": [ | ||
{ | ||
"doc": "count", | ||
"name": "count", | ||
"type": "long" | ||
}, | ||
{ | ||
"doc": "First Name of Customer", | ||
"name": "first_name", | ||
"type": "string" | ||
}, | ||
{ | ||
"doc": "Last Name of Customer", | ||
"name": "last_name", | ||
"type": "string" | ||
}, | ||
{ | ||
"doc": "Address of Customer", | ||
"name": "address", | ||
"type": "string" | ||
} | ||
], | ||
"name": "Customer", | ||
"namespace": "com.github.vdesabou", | ||
"type": "record" | ||
} | ||
EOF | ||
|
||
playground topic produce -t filestream --key 1 --tombstone | ||
|
||
|
||
log "Creating FileStream Sink connector" | ||
playground connector create-or-update --connector filestream-sink << EOF | ||
{ | ||
"tasks.max": "1", | ||
"connector.class": "org.apache.kafka.connect.file.FileStreamSinkConnector", | ||
"topics": "filestream", | ||
"file": "/tmp/output.json", | ||
"transforms": "dropTombstone", | ||
"transforms.dropTombstone.type": "io.yokota.kafka.connect.transform.jsonata.JsonataTransformation", | ||
"transforms.dropTombstone.expr": "value = null ? null : \$" | ||
} | ||
EOF | ||
|
||
|
||
sleep 5 | ||
|
||
log "Verify we have received the data in file" | ||
docker exec connect cat /tmp/output.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters