The goal is to implement a presence platform
based on Spring Boot SSE and Redis (Streams, RedisGears, KeySpace-Notifications )
Realtime Platform
will have two channels - Redis Streams -with the Presence Platform:
Heartbeat Upstream
: RT platform will periodically publish ONLINE client ids -[ client ]
- to thePresence Platform
.Presence Downstream
: Presence platform will publish presence messages -[ client | status: ]
topresence
stream.
Presence platform
logic will be implemented as RedisGears functions as event processors: Heartbeat
and KeySpace notification event processors.
$ git clone https://github.com/oalles/redis-presence
$ cd redis-presence/realtime-service;mvn clean install;cd ../deployment
$ docker-compose up # --build
You can use RedisInsights as GUI.
in order to set: CONFIG SET notify-keyspace-events Kxs
See the configuration description here.
In a given python virtual env, install requirements and run init.py
.
Key expiration IS NOT REAL TIME, while it seems like a real time if you try on local (small key), it’s already stated in the doc that the key might not be notified real time upon expiration event due to redis expiration logic (read the Timing of expired events section of the doc)
- Keyspace Notifications
- Keyspace Notifications how to
- Redisgears
- Keyspace notifications using RedisGears
- Redisgears Examples
- EXPIRE command
1.LOCAL_PRESENCE
branch contains the standalone realtime service with a local push registry, no redis configuration. ``