feat(push-gateway,msg): redis pubsub backplane for real-time notifications
M7: ADR-040 Redis Pub/Sub as state routing backplane
- push-gateway: remove Kafka consumer, add SSE endpoint
- SSE: subscribe to Redis user:{userId}:notify on connect
- msg: publish notifications to Redis Pub/Sub instead of HTTP push
- docker-compose: remove Kafka env from push-gateway
This commit is contained in:
@@ -359,6 +359,16 @@ func idempotentKey(eventID string) string {
|
||||
return "edu:push:idempotent:" + eventID
|
||||
}
|
||||
|
||||
// NotifyChannel returns the Redis Pub/Sub channel name for a user's real-time
|
||||
// notification stream. M7 (ADR-040): msg service publishes notifications to
|
||||
// this channel; realtime-gateway instances subscribe per-connection when a
|
||||
// user connects via SSE.
|
||||
//
|
||||
// Channel naming: `user:{userId}:notify`
|
||||
func NotifyChannel(userID string) string {
|
||||
return "user:" + userID + ":notify"
|
||||
}
|
||||
|
||||
// ParseUserChannel extracts the userID from a "edu:push:channel:user:<userID>"
|
||||
// channel name. Returns empty string when the name does not match.
|
||||
func ParseUserChannel(channel string) string {
|
||||
|
||||
Reference in New Issue
Block a user