redisredis-streamsreddison

Redisson RStreams not receiving messages


I am trying to use streams with redis using Reddison lib. I am using code StreamReadGroupArgs.neverDelivered() when receiving the messages. But if I don't ack it then the next time when readGroup is called it does not get those messages. The problem is that what if the node crashed or there was a glitch in network and I could not process those messages. Then even if I have not ack it I will not get those messages again. Is there a workaround for this or something else that I can do?


Solution

  • This is the correct behavior. Otherwise you will end up receiving redundant messages everytime.

    Either you have to acknowledge or you have to explicitly ask redis to resend the messages which you have not acknowledged. For that StreamReadGroupArgs.neverDelivered() is not a correct option. Because it was already delivered. But you lost the message somehow.

    Correct option for your use case is the below one which will send the messages which are not acknowledged.

    StreamReadGroupArgs.greaterThan(new StreamMessageId(0))