Class: AMQP::Broker

Inherits:
Object
  • Object
show all
Defined in:
lib/amqp/broker.rb

Overview

A utility class that makes inspection of broker capabilities easier.

Constant Summary

RABBITMQ_PRODUCT =

API

"RabbitMQ".freeze

Instance Attribute Summary (collapse)

Product information (collapse)

Product capabilities (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Hash) initialize(properties)

Returns properties Broker information



20
21
22
# File 'lib/amqp/broker.rb', line 20

def initialize(properties)
  @properties = properties
end

Instance Attribute Details

- (Hash) properties (readonly)

Broker information



16
17
18
# File 'lib/amqp/broker.rb', line 16

def properties
  @properties
end

Instance Method Details

- (String) product



32
33
34
# File 'lib/amqp/broker.rb', line 32

def product
  @product ||= @properties["product"]
end

- (Boolean) rabbitmq?



27
28
29
# File 'lib/amqp/broker.rb', line 27

def rabbitmq?
  self.product == RABBITMQ_PRODUCT
end

- (Boolean) supports_basic_nack?



53
54
55
# File 'lib/amqp/broker.rb', line 53

def supports_basic_nack?
  @properties["capabilities"]["basic.nack"]
end

- (Boolean) supports_consumer_cancel_notifications?



58
59
60
# File 'lib/amqp/broker.rb', line 58

def supports_consumer_cancel_notifications?
  @properties["capabilities"]["consumer_cancel_notify"]
end

- (Boolean) supports_exchange_to_exchange_bindings?



63
64
65
# File 'lib/amqp/broker.rb', line 63

def supports_exchange_to_exchange_bindings?
  @properties["capabilities"]["exchange_exchange_bindings"]
end

- (Boolean) supports_publisher_confirmations?



48
49
50
# File 'lib/amqp/broker.rb', line 48

def supports_publisher_confirmations?
  @properties["capabilities"]["publisher_confirms"]
end

- (String) version



37
38
39
# File 'lib/amqp/broker.rb', line 37

def version
  @version ||= @properties["version"]
end