How can I name a consumer when I use redis streams in a k8s environment?

  1. First of all, I'm considering using the hostname of the pod. However, in the k8s environment, the name will change every time the pod is newly created, so the consumer will also be newly created. Would it be okay to use redis streams even if a lot of consumers are made? (ex. performance, memory..)

  2. If it's a problem that a lot of consumers are being created, how do I get rid of old consumers who are periodically disconnected? I'm thinking of a way to make a cron job using a command XGROUP DELCONSUMER. Is there any other good way?

  3. Is there a way to gracefully handle messages that have failed to process and remain pending for a long time? Should the consumer alternate between xreadgroup and xautoclaim command? Or should I have a separate thread that runs xautoclaim periodically?

Comment From: zuiderkwast

Here is a discussion about the same problem: #11567. Welcome to join the discussion!

Comment From: nyongja

Thank you!