Class: AMQP::Broker
- Inherits:
-
Object
- Object
- AMQP::Broker
- Defined in:
- lib/amqp/broker.rb
Overview
A utility class that makes inspection of broker capabilities easier.
Constant Summary collapse
- RABBITMQ_PRODUCT =
API
"RabbitMQ".freeze
Instance Attribute Summary collapse
-
#properties ⇒ Hash
readonly
Broker information.
Product information collapse
-
#product ⇒ String
Broker product information.
-
#rabbitmq? ⇒ Boolean
True if broker is RabbitMQ.
-
#version ⇒ String
Broker version.
Product capabilities collapse
- #supports_basic_nack? ⇒ Boolean
- #supports_consumer_cancel_notifications? ⇒ Boolean
- #supports_exchange_to_exchange_bindings? ⇒ Boolean
- #supports_publisher_confirmations? ⇒ Boolean
Instance Method Summary collapse
-
#initialize(properties) ⇒ Hash
constructor
Properties Broker information.
Constructor Details
#initialize(properties) ⇒ Hash
Returns properties Broker information.
20 21 22 |
# File 'lib/amqp/broker.rb', line 20 def initialize(properties) @properties = properties end |
Instance Attribute Details
#properties ⇒ Hash (readonly)
Broker information
16 17 18 |
# File 'lib/amqp/broker.rb', line 16 def properties @properties end |
Instance Method Details
#product ⇒ String
Returns Broker product information.
32 33 34 |
# File 'lib/amqp/broker.rb', line 32 def product @product ||= @properties["product"] end |
#rabbitmq? ⇒ Boolean
Returns true if broker is RabbitMQ.
27 28 29 |
# File 'lib/amqp/broker.rb', line 27 def rabbitmq? self.product == RABBITMQ_PRODUCT end |
#supports_basic_nack? ⇒ Boolean
53 54 55 |
# File 'lib/amqp/broker.rb', line 53 def supports_basic_nack? @properties["capabilities"]["basic.nack"] end |
#supports_consumer_cancel_notifications? ⇒ Boolean
58 59 60 |
# File 'lib/amqp/broker.rb', line 58 def supports_consumer_cancel_notifications? @properties["capabilities"]["consumer_cancel_notify"] end |
#supports_exchange_to_exchange_bindings? ⇒ Boolean
63 64 65 |
# File 'lib/amqp/broker.rb', line 63 def supports_exchange_to_exchange_bindings? @properties["capabilities"]["exchange_exchange_bindings"] end |
#supports_publisher_confirmations? ⇒ Boolean
48 49 50 |
# File 'lib/amqp/broker.rb', line 48 def supports_publisher_confirmations? @properties["capabilities"]["publisher_confirms"] end |
#version ⇒ String
Returns Broker version.
37 38 39 |
# File 'lib/amqp/broker.rb', line 37 def version @version ||= @properties["version"] end |