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

B::Queue#pop should use Bunny::MessageProperties #212

Closed
mmmries opened this issue May 12, 2014 · 2 comments
Closed

B::Queue#pop should use Bunny::MessageProperties #212

mmmries opened this issue May 12, 2014 · 2 comments
Assignees

Comments

@mmmries
Copy link

mmmries commented May 12, 2014

Right now the Bunny::Queue#pop method returns a triplet of delivery_info, message_properties, payload which looks the same as the values that get yielded from Bunny::Queue#subscribe, but the message_properties value is actually different for these two cases. Subscribe gives back a Bunny::MessageProperties object and pop gives back a Hash.

Example:

require "bunny"

conn = Bunny.new
conn.start

ch   = conn.create_channel
q    = ch.queue("images.resize", :exclusive => false, :auto_delete => true)

delivery_info, message_properties, payload = q.pop
message_properties.class # => Hash

q.subscriber do |delivery_info, message_properties, payload|
  message_properties.class # => Bunny::MessageProperties
end

It would be nice if these two interfaces for getting messages were consistent. If someone wants to be point me in the right direction I'd be happy to take a look and make a pull request.

@michaelklishin
Copy link
Member

Bunny::Queue#pop should use Bunny::MessageProperties. Hash is a leftover from pre-0.9 days.

@michaelklishin michaelklishin changed the title pop vs subscribe B::Queue#pop should use Bunny::MessageProperties May 13, 2014
@michaelklishin michaelklishin self-assigned this May 13, 2014
@mmmries
Copy link
Author

mmmries commented May 13, 2014

Thanks @michaelklishin! I was going to try to reconcile this today at work, but it looks like you beat me to it!

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

2 participants