Refactor the retry() middleware to have a message store provider pattern. The pattern will allow you to have a MemoryStore which will track retry counts in memory, or for instance a RedisStore which will track message cids and their associated retry counts in redis.
This will make the api difference between "local" and "distributed" more obvious, simply replacing them with the use of the store. A distributed model will no longer depend on the need to modify message properties (RabbitMQ doesn't allow us to do this on a reject(requeue=true), which is currently forcing us to resend messages on the back of a queue when rejecting. We would prefer to simply reject(requeue=true).
Refactor the retry() middleware to have a message store provider pattern. The pattern will allow you to have a MemoryStore which will track retry counts in memory, or for instance a RedisStore which will track message cids and their associated retry counts in redis.
This will make the api difference between "local" and "distributed" more obvious, simply replacing them with the use of the store. A distributed model will no longer depend on the need to modify message properties (RabbitMQ doesn't allow us to do this on a reject(requeue=true), which is currently forcing us to resend messages on the back of a queue when rejecting. We would prefer to simply reject(requeue=true).