Ákos Vandra-Meyer
Ákos Vandra-Meyer

Reputation: 2165

get last ACKed id of all consumer groups

I'm trying to use redis as a low-cost kafka alternative for not-so critical data.

I'm trying to create a background job that would trim my streams. The idea would be to get a snapshot of the state of the consumer groups, and trim the stream to the last element that has been acknowledged by all consumer groups.

XINFO groups however only returns the last delivered ID, and not the last acknowledged ID, and XPENDING can only be called per group.

Is there a way to figure out the correct Id that one can safely trim to to remain fault tolerant in case on of the delivered messages is failed to be processed?

Clarification:

My consumer groups are of low consumer cardinality, expect to receive new messages added AFTER they subscribe, including messages sent into the stream while they were offline for whatever reason, such as a reboot, so pub/sub is not an alternative

So new consumer groups do not expect old messages to be replayed when joining the stream.

Upvotes: 0

Views: 23

Answers (0)

Related Questions