Class: Orchestration::Services::RabbitMQ::Healthcheck

Inherits:
Object
  • Object
show all
Includes:
HealthcheckBase
Defined in:
lib/orchestration/services/rabbitmq/healthcheck.rb

Instance Attribute Summary

Attributes included from HealthcheckBase

#configuration

Instance Method Summary collapse

Methods included from HealthcheckBase

included, #initialize, #service_name

Instance Method Details

#connectObject



19
20
21
22
23
24
25
# File 'lib/orchestration/services/rabbitmq/healthcheck.rb', line 19

def connect
  host = @configuration.host
  port = @configuration.port
  connection = Bunny.new("amqp://#{host}:#{port}", log_file: devnull)
  connection.start
  connection.stop
end

#connection_errorsObject



11
12
13
14
15
16
17
# File 'lib/orchestration/services/rabbitmq/healthcheck.rb', line 11

def connection_errors
  [
    Bunny::TCPConnectionFailedForAllHosts,
    AMQ::Protocol::EmptyResponseError,
    Errno::ECONNRESET
  ]
end