LastTribunal
LastTribunal

Reputation: 1

Redis Cache Pub Sub delete after receive

Is there a way to delete a message from a subscriber, once it is received by that subscriber so as to prevent it from being read by another subscriber to the same channel?

Note: this behavior is supported on Azure Service Bus..

Upvotes: 1

Views: 2225

Answers (1)

for_stack
for_stack

Reputation: 22886

NO, you cannot do that with Redis pubsub.

However, you can achieve the goal with Redis Stream. You can create a consumer group with the XGROUP CREATE command. For each message in a Redis Stream, only one consumer in the group can read the message. Check this for detail.

Upvotes: 2

Related Questions