Sha256: 171b332c2e0d741538f93f0110f89f1a9d156b3f173b7e37c8d771c19dcff619

Contents?: true

Size: 578 Bytes

Versions: 4

Compression:

Stored size: 578 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
          ]
        end

        def connect
          port = @configuration.local_port

          connection = Bunny.new("amqp://localhost:#{port}", log_file: devnull)
          connection.start
          connection.stop
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
orchestration-0.3.1 lib/orchestration/services/rabbitmq/healthcheck.rb
orchestration-0.3.0 lib/orchestration/services/rabbitmq/healthcheck.rb
orchestration-0.2.8 lib/orchestration/services/rabbitmq/healthcheck.rb
orchestration-0.2.7 lib/orchestration/services/rabbitmq/healthcheck.rb