alphasights / sneakers_handlers

Retries with exponential backoff for sneakers
MIT License
33 stars 11 forks source link

Create handler to retry rejected messages #3

Closed abepetrillo closed 8 years ago

abepetrillo commented 8 years ago

This change introduces a retry handler. If a message is rejected for any reason, the same message will be processed again for a given number of times. The default number of retries is 5.

Do not foget to include the routing key for your dlx queue: x-dead-letter-routing-key as demonstrated in the comments.

This is mostly copying @brianstorti's code from another repo, so thanks man!

abepetrillo commented 8 years ago

@jjbohn Please Review.

jjbohn commented 8 years ago

Instead of asking people to remember to add x-dead-letter-routing-key, can we make it so they have to? Throw an error saying they need it for instance?

jjbohn commented 8 years ago

Should we automatically bind the main queue with a routing key of it's name so there's no manual setup that needs to happen?

For instance, something like cp-dashboard.interaction_updater would get bound to two routing keys, interaction.lifecycle.update and cp-dashboard.interaction_updater.

jjbohn commented 8 years ago

We should fully test out timeouts, rejects, etc.

brianstorti commented 8 years ago

@jjbohn hm, what manual step are you referring to? I don't see how binding the main queue with another routing key of its name would change anything.

jjbohn commented 8 years ago

@brianstorti oh, nm, I read something wrong. Ignore the manual comment.

abepetrillo commented 8 years ago

@jjbohn second look?

jjbohn commented 8 years ago

:+1: