@@ -96,36 +96,40 @@ curl -X POST -H "Content-Type: application/json" --data '
96
96
"value.converter.schemas.enable": "false"
97
97
}}' http://localhost:8083/connectors -w " \n"
98
98
99
- # sleep 2
100
- # echo -e "\nAdding MongoDB Kafka Source Connector for the 'test.pageviews' collection:"
101
- # curl -X POST -H "Content-Type: application/json" --data '
102
- # {"name": "mongo-source",
103
- # "config": {
104
- # "tasks.max":"1",
105
- # "connector.class":"com.mongodb.kafka.connect.MongoSourceConnector",
106
- # "connection.uri":"mongodb://mongo1:27017,mongo2:27017,mongo3:27017",
107
- # "topic.prefix":"mongo",
108
- # "database":"test",
109
- # "collection":"pageviews"
110
- # }}' http://localhost:8083/connectors -w "\n"
99
+ sleep 2
100
+ echo -e " \nAdding Redis Enterprise Kafka Source Connector for the 'mystream' stream:"
101
+ curl -X POST -H " Content-Type: application/json" --data '
102
+ {"name": "redis-enterprise-source",
103
+ "config": {
104
+ "tasks.max":"1",
105
+ "connector.class":"com.redislabs.kafka.connect.RedisEnterpriseSourceConnector",
106
+ "redis.uri":"redis://redis:6379",
107
+ "redis.stream.name":"mystream"
108
+ }}' http://localhost:8083/connectors -w " \n"
111
109
112
110
sleep 2
113
111
echo -e " \nKafka Connectors: \n"
114
112
curl -X GET " http://localhost:8083/connectors/" -w " \n"
115
113
116
- echo " Looking at data in 'pageviews':"
114
+ echo " Number of messages in 'pageviews' stream :"
117
115
docker-compose exec redis /usr/local/bin/redis-cli xlen pageviews
118
116
117
+ sleep 2
118
+ echo -e " \nAdding messages to Redis stream 'mystream':"
119
+ docker-compose exec redis /usr/local/bin/redis-cli " xadd" " mystream" " *" " field1" " message1: value1" " field2" " message1: value2"
120
+ docker-compose exec redis /usr/local/bin/redis-cli " xadd" " mystream" " *" " field1" " message2: value1" " field2" " message2: value2"
121
+
119
122
echo -e ' ' '
120
123
124
+
121
125
==============================================================================================================
122
126
Examine the topics in the Kafka UI: http://localhost:9021 or http://localhost:8000/
123
127
- The `pageviews` topic should have the generated page views.
124
- - The `mongo.test.pageviews ` topic should contain the change events .
125
- - The `test. pageviews` collection in MongoDB should contain the sinked page views.
128
+ - The `mystream ` topic should contain the Redis stream messages .
129
+ - The `pageviews` stream in Redis should contain the sunk page views.
126
130
127
131
Examine the collections:
128
- - In your shell run: docker-compose exec mongo1 /usr/bin/mongo
132
+ - In your shell run: docker-compose exec redis /usr/local/ bin/redis-cli
129
133
==============================================================================================================
130
134
131
135
Use <ctrl>-c to quit' ' '
0 commit comments