0

I am using spring boot 3 with spring data redis with functionality like this example example . My solution is deployed in kubernetes cluster in multi pods configuration. I am producing a message from 1 pod and consuming on another pod. (I mean I want to have this behaviour 1 producer will produce message and only 1 will consume the message and delete it) However, I want only one pod to consume the message but right now I can see all pods are consuming same message at same time. How do I restrict this behaviour?

I want only one pod to consume the message but right now I can see all pods are consuming same message at same time. How do I restrict this behaviour?

DJDeveloper
  • 91
  • 1
  • 4
  • 1
    What you want is so called consumer groups: https://redis.io/docs/data-types/streams-tutorial/#consumer-groups But all consumer in the same group and only one will process the message. This question should point you to the right answer: https://stackoverflow.com/questions/61465222/how-to-use-consumer-groups-with-spring-data-redis-for-redis-streams-keep-gettin – jAC Jun 03 '23 at 09:55

0 Answers0