I am using Stackexchange.Redis package in .NET Core 3.1
I can use pub-sub method like this:-
var channel = connectionMultiplexer.GetSubscriber().Subscribe("channel1");
channel.OnMessage(msg =>
{
var message = msg.Message;
Console.Out.WriteLine(message);
});
But pub-sub is not stored anywhere in the Redis server. I found redis stream persists in the redis store. So I wanted to replace pub-sub with the stream. But I don’t see any way to implement this as I did for pub-sub. How can I implement pub-sub like way for stream data?
2
Answers
Try with:
So using the Stackexchange.Redis package, I have also searched and could not find an answer, however, I came across this question and in the question the user refers to this github issue . In the Github issue, chrisckc proposes a slight work around that uses both the Streams as well as Pub/Sub to achieve an almost Pub/Sub for streams. I encourage you to read the Github issue for some of the cons. So this is my take on how to implement it using chrisckc suggestion