Reputation: 205
Here goes my use case:
We use redis appender to write our log messages to redis. These messages have MDC data (Trace Id) to track individual requests. We want other application to subscribe to the trace id and get all the messages logged (As they are inserted). Can we have some sort of a trigger that can publish the message as it is being added?
The appender does not provide us with the ability to publish to a channel and we don't want to create a custom publisher for this use case. I am sure this use case is not unique and am hoping for a recommendation. basically looking for something like a trigger that rdbms have on insert.
Upvotes: 0
Views: 371
Reputation: 50102
Consider using the Stream (v5) data type for storing your log, and having consumers consume that stream for incoming updates.
Upvotes: 1
Reputation: 3693
Redis Keyspace Notifications sound like they might fit your use case: https://redis.io/topics/notifications
You can subscribe to a variety of notification types and I would guess that one of those would fit your need.
Upvotes: 1