mpneuried / rsmq-worker

Helper to simply implement a worker around RSMQ ( Redis Simple Message Queue )
MIT License
117 stars 24 forks source link

Message goes both to 'exceeded' and 'message' #50

Open nicolasGab opened 4 years ago

nicolasGab commented 4 years ago

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?

ketansp commented 3 weeks ago

I can confirm this behavior. Do we know what's the problem here?