Sha256: 8d76fe7a20a27a816ac09c1737cc10d73b6acc0f0e71fd4e19dcb9446f1bb020

Contents?: true

Size: 792 Bytes

Versions: 3

Compression:

Stored size: 792 Bytes

Contents

# encoding: utf-8

require 'java'
require 'ext/commons-io'
require 'ext/rabbitmq-client'


module HotBunnies
  import com.rabbitmq.client.ConnectionFactory
  import com.rabbitmq.client.Connection
  import com.rabbitmq.client.Channel
  import com.rabbitmq.client.DefaultConsumer
  import com.rabbitmq.client.QueueingConsumer

  import com.rabbitmq.client.AMQP

  CONNECTION_PROPERTIES = [:host, :port, :virtual_host, :connection_timeout, :username, :password]

  def self.connect(options={})
    cf = ConnectionFactory.new
    CONNECTION_PROPERTIES.each do |property|
      if options[property]
        cf.send("#{property}=".to_sym, options[property])
      end
    end
    cf.new_connection
  end
end

require 'hot_bunnies/channel'
require 'hot_bunnies/queue'
require 'hot_bunnies/exchange'

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hot_bunnies-1.2.2-java lib/hot_bunnies.rb
hot_bunnies-1.2.1-java lib/hot_bunnies.rb
hot_bunnies-1.2.0-java lib/hot_bunnies.rb