Sha256: 6ba1b8bea329914593c26d347639700d4d4eed00064875793bbd42e640a5bdcd

Contents?: true

Size: 549 Bytes

Versions: 8

Compression:

Stored size: 549 Bytes

Contents

#!/usr/bin/env ruby
# encoding: utf-8

require "rubygems"
require "amqp"

# Binding a queue to an exchange
AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672/") do |connection, open_ok|
  AMQP::Channel.new do |channel, open_ok|
    exchange = channel.fanout("amq.fanout")

    channel.queue("", :auto_delete => true, :exclusive => true) do |queue, declare_ok|
      queue.bind(exchange) do |bind_ok|
        puts "Just bound #{queue.name} to #{exchange.name}"
      end

      connection.close {
        EM.stop { exit }
      }
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
amqp-0.8.0.rc11 examples/guides/queues/05_binding_a_queue_using_exchange_instance.rb
amqp-0.8.0.rc10 examples/guides/queues/05_binding_a_queue_using_exchange_instance.rb
amqp-0.8.0.rc9 examples/guides/queues/05_binding_a_queue_using_exchange_instance.rb
amqp-0.8.0.rc8 examples/guides/queues/05_binding_a_queue_using_exchange_instance.rb
amqp-0.8.0.rc7 examples/guides/queues/05_binding_a_queue_using_exchange_instance.rb
amqp-0.8.0.rc6 examples/guides/queues/05_binding_a_queue_using_exchange_instance.rb
amqp-0.8.0.rc5 examples/guides/queues/05_binding_a_queue_using_exchange_instance.rb
amqp-0.8.0.rc4 examples/guides/queues/05_binding_a_queue_using_exchange_instance.rb