Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Avoid handlers from picking up dead lettered messages? #120

Closed
n321203 opened this issue Feb 2, 2016 · 1 comment
Closed

Question: Avoid handlers from picking up dead lettered messages? #120

n321203 opened this issue Feb 2, 2016 · 1 comment

Comments

@n321203
Copy link

n321203 commented Feb 2, 2016

Hi, I am learning wascally and like it this far. There's something I don't understand about the handlers:

Fact 1: handlers are not bound to a specific exchange or queue, but to a message type.

Fact 2: when using dead-lettering, a rejected message is sent to a dead-letter-exchange with (possibly) a new routingKey, but the message type is unchanged.

This means that the original handler will pick up the rejected message once again.

What have I missed here – how do you use dead-lettering with wascally? It seems you have to add a check in every handler that the received message isn't dead already (if you don't wanna try processing it again... but then I would have nack it instead of rejectit...).

@n321203 n321203 changed the title Question: How do you handle() dead lettered messages? Question: Handlers picking up dead lettered messages Feb 2, 2016
@n321203 n321203 changed the title Question: Handlers picking up dead lettered messages Question: Avoid handlers from picking up dead lettered messages? Feb 2, 2016
@n321203
Copy link
Author

n321203 commented Feb 3, 2016

Update: I have solved this by setting a routingKey on each message, and never set a message type. This way, the handlers fall back to using routingKeys (since message types are not available).
The dead-lettering-exchange changes the routingKey, which means a separate handler picks up all rejected messages.

@n321203 n321203 closed this as completed Feb 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant