Write a Redis subscriber plug-in
Build
Run
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 | #!/bin/bash
./slingshot redis subscribe \
--wasm=./redissub.wasm \
--handler=message \
--uri=${REDIS_URI} \
--client-id=pubsubcli \
--channel=news
# Output:
π redis URI : *****
π redis Client Id: pubsubcli
π handler : message
π¦ wasm : ./redissub.wasm
πΊ channel : news
|
Trigger the plugin
Connect to the Redis server:
| #!/bin/bash
redis-cli -u ${REDIS_URI}
|
Publish message(s):
| redis.aivencloud.com:17170> PUBLISH news "Hello World"
|
Output
| π message: {"id":"pubsubcli","channel":"news","payload":"Hello World"}
|