Class: RosettaQueue::Gateway::AmqpSynchAdapter

Inherits:
Amqp show all
Defined in:
lib/rosetta_queue/adapters/amqp.rb

Overview

This AMQP adapter utilizes the synchronous AMPQ client ‘Bunny’ by celldee (github.com/celldee/bunny)

Instance Method Summary collapse

Methods inherited from Amqp

#delete, #disconnect, #initialize, #receive_once, #receive_with, #send_message, #unsubscribe

Constructor Details

This class inherits a constructor from RosettaQueue::Gateway::Amqp

Instance Method Details

#exchange_strategy_for(destination, options = {}) ⇒ Object



71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/rosetta_queue/adapters/amqp.rb', line 71

def exchange_strategy_for(destination, options={})
  case destination
  when /^fanout\./
    @exchange ||= SynchExchange::FanoutExchange.new(@adapter_settings, options)
  when /^topic\./
    raise "Sorry.  RosettaQueue can not process AMQP topics yet"
  when /^queue\./
    @exchange ||= SynchExchange::DirectExchange.new(@adapter_settings, options)
  else
    @exchange ||= SynchExchange::DirectExchange.new(@adapter_settings, options)
  end
end