@@ -18,7 +18,7 @@ curl --request POST \
18
18
"value.converter": "io.confluent.connect.avro.AvroConverter",
19
19
"value.converter.schema.registry.url": "http://kafka-schema-registry:8081",
20
20
"tasks.max": "1",
21
- "topics": "redis.commands.set,redis.commands.expire,redis.commands.expireat,redis.commands.pexpire,redis.commands.sadd,redis.commands.geoadd",
21
+ "topics": "redis.commands.set,redis.commands.expire,redis.commands.expireat,redis.commands.pexpire,redis.commands.sadd,redis.commands.geoadd,redis.commands.arbitrary ",
22
22
"redis.uri": "redis://IEPfIr0eLF7UsfwrIlzy80yUaBG258j9@redis-cluster",
23
23
"redis.cluster.enabled": true
24
24
}
@@ -112,6 +112,17 @@ kafka-avro-console-producer \
112
112
> {" key" :" Sicily" ," values" :[{" longitude" :13.361389," latitude" :13.361389," member" :" Palermo" },{" longitude" :15.087269," latitude" :37.502669," member" :" Catania" }]}
113
113
```
114
114
115
+ ``` bash
116
+ kafka-avro-console-producer \
117
+ --broker-list kafka-broker-0.kafka-broker:9092 \
118
+ --property schema.registry.url=' http://kafka-schema-registry:8081' \
119
+ --property value.schema=' {"namespace":"io.github.jaredpetersen.kafkaconnectredis","name":"RedisArbitraryCommand","type":"record","fields":[{"name":"command","type":"string"},{"name":"arguments","type":{"type":"array","items":"string"}}]}' \
120
+ --topic redis.commands.arbitrary
121
+ > {" command" :" TS.CREATE" ," arguments" :[" temperature:3:11" , " RETENTION" , " 60" , " LABELS" , " sensor_id" , " 2" , " area_id" , " 32" ]}
122
+ > {" command" :" TS.ADD" ," arguments" :[" temperature:3:11" , " 1548149181" , " 30" ]}
123
+ > {" command" :" TS.ADD" ," arguments" :[" temperature:3:11" , " 1548149191" , " 42" ]}
124
+ ```
125
+
115
126
### Connect JSON
116
127
Create an interactive ephemeral query pod:
117
128
``` bash
@@ -134,6 +145,9 @@ kafka-console-producer \
134
145
> {" payload" :{" key" :" {user.1}.interests" ," values" :[" reading" ]}," schema" :{" name" :" io.github.jaredpetersen.kafkaconnectredis.RedisSaddCommand" ," type" :" struct" ," fields" :[{" field" :" key" ," type" :" string" ," optional" :false},{" field" :" values" ," type" :" array" ," items" :{" type" :" string" }," optional" :false}]}}
135
146
> {" payload" :{" key" :" {user.2}.interests" ," values" :[" sailing" ," woodworking" ," programming" ]}," schema" :{" name" :" io.github.jaredpetersen.kafkaconnectredis.RedisSaddCommand" ," type" :" struct" ," fields" :[{" field" :" key" ," type" :" string" ," optional" :false},{" field" :" values" ," type" :" array" ," items" :{" type" :" string" }," optional" :false}]}}
136
147
> {" payload" :{" key" :" Sicily" ," values" :[{" longitude" :13.361389," latitude" :13.361389," member" :" Palermo" },{" longitude" :15.087269," latitude" :37.502669," member" :" Catania" }]}," schema" :{" name" :" io.github.jaredpetersen.kafkaconnectredis.RedisGeoaddCommand" ," type" :" struct" ," fields" :[{" field" :" key" ," type" :" string" ," optional" :false},{" field" :" values" ," type" :" array" ," items" :{" type" :" struct" ," fields" :[{" field" :" longitude" ," type" :" double" ," optional" :false},{" field" :" latitude" ," type" :" double" ," optional" :false},{" field" :" member" ," type" :" string" ," optional" :false}]}," optional" :false}]}}
148
+ > {" payload" :{" command" :" TS.CREATE" ," arguments" :[" temperature:3:11" , " RETENTION" , " 60" , " LABELS" , " sensor_id" , " 2" , " area_id" , " 32" ]}," schema" :{" name" :" io.github.jaredpetersen.kafkaconnectredis.RedisArbitraryCommand" ," type" :" struct" ," fields" :[{" field" :" command" ," type" :" string" ," optional" :false},{" field" :" arguments" ," type" :" array" ," items" :{" type" :" string" }," optional" :false}]}}
149
+ > {" payload" :{" command" :" TS.ADD" ," arguments" :[" temperature:3:11" , " 1548149181" , " 30" ]}," schema" :{" name" :" io.github.jaredpetersen.kafkaconnectredis.RedisArbitraryCommand" ," type" :" struct" ," fields" :[{" field" :" command" ," type" :" string" ," optional" :false},{" field" :" arguments" ," type" :" array" ," items" :{" type" :" string" }," optional" :false}]}}
150
+ > {" payload" :{" command" :" TS.ADD" ," arguments" :[" temperature:3:11" , " 1548149191" , " 42" ]}," schema" :{" name" :" io.github.jaredpetersen.kafkaconnectredis.RedisArbitraryCommand" ," type" :" struct" ," fields" :[{" field" :" command" ," type" :" string" ," optional" :false},{" field" :" arguments" ," type" :" array" ," items" :{" type" :" string" }," optional" :false}]}}
137
151
```
138
152
139
153
## Validate
@@ -160,4 +174,5 @@ PTTL product.waffles
160
174
SMEMBERS {user.1}.interests
161
175
SMEMBERS {user.2}.interests
162
176
GEOPOS Sicily Catania
177
+ TS.RANGE temperature:3:11 1548149180 1548149210 AGGREGATION avg 5
163
178
```
0 commit comments