Skip to content

Commit fa32ef4

Browse files
committed
Added RedisJSON sink config to Docker example. Resolves #6
1 parent 117a0c7 commit fa32ef4

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

docker/run.sh

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,24 @@ curl -X POST -H "Content-Type: application/json" --data '
9696
"value.converter.schemas.enable": "false"
9797
}}' http://localhost:8083/connectors -w "\n"
9898

99+
sleep 2
100+
echo -e "\nAdding Redis Enterprise Kafka Sink Connector for the 'pageviews' topic into RedisJSON:"
101+
curl -X POST -H "Content-Type: application/json" --data '
102+
{"name": "redis-enterprise-sink-json",
103+
"config": {
104+
"connector.class":"com.redis.kafka.connect.RedisEnterpriseSinkConnector",
105+
"tasks.max":"1",
106+
"topics":"pageviews",
107+
"redis.uri":"redis://redis:6379",
108+
"redis.type":"JSON",
109+
"key.converter": "org.apache.kafka.connect.json.JsonConverter",
110+
"value.converter": "org.apache.kafka.connect.storage.StringConverter",
111+
"value.converter.schemas.enable": "false",
112+
"transforms": "Cast",
113+
"transforms.Cast.type": "org.apache.kafka.connect.transforms.Cast$Key",
114+
"transforms.Cast.spec": "string"
115+
}}' http://localhost:8083/connectors -w "\n"
116+
99117
sleep 2
100118
echo -e "\nAdding Redis Enterprise Kafka Source Connector for the 'mystream' stream:"
101119
curl -X POST -H "Content-Type: application/json" --data '
@@ -129,8 +147,10 @@ Examine the topics in the Kafka UI: http://localhost:9021 or http://localhost:80
129147
- The `mystream` topic should contain the Redis stream messages.
130148
The `pageviews` stream in Redis should contain the sunk page views: redis-cli xlen pageviews
131149
132-
Examine the collections:
150+
Examine the Redis database:
133151
- In your shell run: docker-compose exec redis /usr/local/bin/redis-cli
152+
- List some RedisJSON keys: SCAN 0 TYPE ReJSON-RL
153+
- Show the JSON value of a given key: JSON.GET 971
134154
==============================================================================================================
135155
136156
Use <ctrl>-c to quit'''

0 commit comments

Comments
 (0)