rsmq-worker
rsmq-worker copied to clipboard
Message goes both to 'exceeded' and 'message'
I am using the RSMQ-worker package to handle messages coming from a Redis instance. Main functionalities are triggered on the 'message' event. When I fail to handle a message, it is put back in the Redis queue and the :rc (receive count) key is incremented.
When a message hits an :rc of 10, it goes to a different queue via the 'exceeded' event. The problem is that both the 'message' and the 'exceeded' events are triggered when a message has been received 10 times. This means that I am marking the failed message as up for something else while trying to process it as a normal message. If the tenth retry succeeds, the message is practically duplicated.
Is this expected behaviour? Should I insert extra conditions for exceeded messages?
I can confirm this behavior. Do we know what's the problem here?