Commit 1baeb52
Changed files (2)
lib
example2
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)