Hi,

With redis 5.0.5, Use the stream and consumer groups. Implementation messages are consumed by all consumer groups.

I want to know how to automatically delete the message after received XACK from all consumer groups.

1、Multiple consumer groups

2、A message is consumed by each consumer groups

3、Redis automatically delete the message after received XACK from all consumer groups.

Could you please provide another option command to do this?

Thanks

Comment From: leomurillo

We can use XINFO GROUPS to get all consumer groups, including the "last-delivered-id", the minimum of these tells us up to where we can delete in your case.

It would be nice to have an XTRIM key BELOW [~] ID, to then trim easily.

The XTRIM doc says "The command is conceived to accept multiple trimming strategies, however currently only a single one is implemented, which is MAXLEN", so it may be in the kitchen

Comment From: itamarhaber

kitchen ref: #6640

Comment From: fsfarah

How about this workaround?

MULTI
XACK mystream mygroup <id>
XDEL mystream <id>
EXEC