Class: MessageQueue::Adapters::Bunny

Inherits:
Adapter
  • Object
show all
Defined in:
lib/message_queue/adapters/bunny.rb

Defined Under Namespace

Classes: Connection

Instance Method Summary collapse

Methods inherited from Adapter

new_connection

Instance Method Details

#new_connection(serializer, options = {}) ⇒ Object

Public: Initialize a RabbitMQ connection.

options - The Hash options used to initialize a connection.

:uri - The String URI described in http://rubybunny.info/articles/connecting.html.

Returns MessageQueue::Adapters::Bunny::Connection if the options are valid. Raises ArgumentError when connection URI schema is not amqp or amqps, or the path contains multiple segments.



13
14
15
16
# File 'lib/message_queue/adapters/bunny.rb', line 13

def new_connection(serializer, options = {})
  settings = options[:uri] ? AMQ::Settings.parse_amqp_url(options[:uri]).merge(options) : options
  Connection.new(serializer, settings)
end