Permalink
Browse files

Make sure Bunny::Channel#basic_publish supports :persistent as well a…

…s :delivery_mode
  • Loading branch information...
1 parent baf133c commit 6cd73ebdf98fb1da2863f6a7dd84e1bcdf510cb4 Michael Klishin committed Jan 16, 2013
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/bunny/channel.rb
View
@@ -468,7 +468,12 @@ def basic_publish(payload, exchange, routing_key, opts = {})
exchange
end
- meta = { :priority => 0, :delivery_mode => 2, :content_type => "application/octet-stream" }.
+ mode = if opts.fetch(:persistent, true)
+ 2
+ else
+ 1
+ end
+ meta = { :priority => 0, :delivery_mode => mode, :content_type => "application/octet-stream" }.
merge(opts)
if @next_publish_seq_no > 0

0 comments on commit 6cd73eb

Please sign in to comment.