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

Add basic implementation for mandatory publishes and return handlers #48

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jwoodrow
Copy link

Hi 👋

I know this is very very very basic (I'm not event mocking a Bunny::BasicReturn) but I had the need to test my on_return behaviour when publishing messages with a mandatory: true option.

It works as is but:

  • Would be better to emulate Bunny's BasicReturn logic (I couldn't figure out how)
  • Could not find where to add some specs for this

Methods added:

  • on_return(&block) : public method on Bunny::Exchange (exact same implementation as Bunny)
  • handle_return(basic_return, properties, content) : private method on Bunny::Exchange

Methods updated:

  • deliver for Direct, Topic, Fanout (Headers does not work as intended so I haven't changed anything)
    • If opts[:mandatory] is true then deliver will call handle_return to notify that the message could not be delivered.

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

Successfully merging this pull request may close these issues.

1 participant