Class: Orchestration::Services::RabbitMQ::Healthcheck
- Inherits:
-
Object
- Object
- Orchestration::Services::RabbitMQ::Healthcheck
- Includes:
- HealthcheckBase
- Defined in:
- lib/orchestration/services/rabbitmq/healthcheck.rb
Instance Attribute Summary
Attributes included from HealthcheckBase
Instance Method Summary collapse
- #connect ⇒ Object
- #connection_errors ⇒ Object
-
#initialize(env) ⇒ Healthcheck
constructor
A new instance of Healthcheck.
Methods included from HealthcheckBase
Constructor Details
#initialize(env) ⇒ Healthcheck
Returns a new instance of Healthcheck.
9 10 11 |
# File 'lib/orchestration/services/rabbitmq/healthcheck.rb', line 9 def initialize(env) @configuration = Configuration.new(env) end |
Instance Method Details
#connect ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/orchestration/services/rabbitmq/healthcheck.rb', line 20 def connect host = @configuration.settings.fetch('host') port = @configuration.settings.fetch('port') connection = Bunny.new("amqp://#{host}:#{port}", log_file: devnull) connection.start connection.stop end |
#connection_errors ⇒ Object
13 14 15 16 17 18 |
# File 'lib/orchestration/services/rabbitmq/healthcheck.rb', line 13 def connection_errors [ Bunny::TCPConnectionFailedForAllHosts, AMQ::Protocol::EmptyResponseError ] end |