Sha256: 2eb1d27099a215e3aa7ab4db28c3ad515a453b7fdadf55b2ee73324104d45164

Contents?: true

Size: 673 Bytes

Versions: 2

Compression:

Stored size: 673 Bytes

Contents

# frozen_string_literal: true

module Orchestration
  module Services
    module RabbitMQ
      class Healthcheck
        include HealthcheckBase

        dependencies 'bunny'

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

        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
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
orchestration-0.3.17 lib/orchestration/services/rabbitmq/healthcheck.rb
orchestration-0.3.16 lib/orchestration/services/rabbitmq/healthcheck.rb