Commit 1baeb52

mo khan <mo@mokhan.ca>
2014-10-10 16:27:51
create a durable queue that will persist messages to disk rather than just memory.
1 parent b0d95a0
Changed files (2)
lib/example2/receive.rb
@@ -7,7 +7,7 @@ connection = Bunny.new
 connection.start
 
 channel = connection.create_channel
-queue = channel.queue("hello")
+queue = channel.queue("task_queue", durable: true)
 
 puts " [*] Waiting for messages in #{queue.name}. To exit press CTRL+C"
 queue.subscribe(manual_ack: true, block: true) do |delivery_info, properties, body|
lib/example2/send.rb
@@ -7,7 +7,7 @@ connection = Bunny.new
 connection.start
 
 channel = connection.create_channel
-queue = channel.queue("hello")
+queue = channel.queue("task_queue", durable: true)
 
 message  = ARGV.empty? ? "Hello World!" : ARGV.join(" ")
 queue.publish(message, persistent: true)