mateodelnorte / servicebus

Simple service bus for sending events between processes using amqp.
MIT License
420 stars 66 forks source link

Refactor retry() middleware to accept message store provider #44

Closed mateodelnorte closed 9 years ago

mateodelnorte commented 9 years ago

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).