Skip to content

Latest commit

 

History

History
46 lines (33 loc) · 2.51 KB

README.md

File metadata and controls

46 lines (33 loc) · 2.51 KB

Overview

The goal is to implement a presence platform based on Spring Boot SSE and Redis (Streams, RedisGears, KeySpace-Notifications )

Diagram

Realtime Platform will have two channels - Redis Streams -with the Presence Platform:

  • Heartbeat Upstream: RT platform will periodically publish ONLINE client ids - [ client ] - to the Presence Platform.
  • Presence Downstream: Presence platform will publish presence messages - [ client | status: ] to presence stream.

Presence platform logic will be implemented as RedisGears functions as event processors: Heartbeat and KeySpace notification event processors.

How to run

$ git clone https://github.com/oalles/redis-presence
$ cd redis-presence/realtime-service;mvn clean install;cd ../deployment
$ docker-compose up # --build

Enable Key Space Notifications

You can use RedisInsights as GUI. in order to set: CONFIG SET notify-keyspace-events Kxs

See the configuration description here.

Load RG scripts

In a given python virtual env, install requirements and run init.py.

Must Read

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)

Timing of Expired Events

Useful Links:

Standole Realtime - Local Push Registry

1.LOCAL_PRESENCE branch contains the standalone realtime service with a local push registry, no redis configuration. ``

3 client