Sha256: f1ba103bbd34cd634580ea4a27febe40f6a7d424f992d1b973849667f14782c3

Contents?: true

Size: 700 Bytes

Versions: 55

Compression:

Stored size: 700 Bytes

Contents

# frozen_string_literal: true

module Orchestration
  module Services
    module RabbitMQ
      class Configuration
        include ConfigurationBase

        self.service_name = 'rabbitmq'

        def enabled?
          defined?(::Bunny)
        end

        def friendly_config
          "[bunny] amqp://#{host}:#{port}"
        end

        def host
          from_url['host'] || super
        end

        def port
          from_url['port'] || super
        end

        private

        def from_url
          return {} if @env.rabbitmq_url.nil?

          uri = URI.parse(@env.rabbitmq_url)
          { 'host' => uri.host, 'port' => uri.port || 5672 }
        end
      end
    end
  end
end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
orchestration-0.7.15 lib/orchestration/services/rabbitmq/configuration.rb
orchestration-0.6.16 lib/orchestration/services/rabbitmq/configuration.rb
orchestration-0.7.14 lib/orchestration/services/rabbitmq/configuration.rb
orchestration-0.7.13 lib/orchestration/services/rabbitmq/configuration.rb
orchestration-0.6.15 lib/orchestration/services/rabbitmq/configuration.rb
orchestration-0.7.12 lib/orchestration/services/rabbitmq/configuration.rb
orchestration-0.6.14 lib/orchestration/services/rabbitmq/configuration.rb
orchestration-0.7.11 lib/orchestration/services/rabbitmq/configuration.rb
orchestration-0.6.13 lib/orchestration/services/rabbitmq/configuration.rb
orchestration-0.7.10 lib/orchestration/services/rabbitmq/configuration.rb
orchestration-0.7.9 lib/orchestration/services/rabbitmq/configuration.rb
orchestration-0.6.12 lib/orchestration/services/rabbitmq/configuration.rb
orchestration-0.7.8 lib/orchestration/services/rabbitmq/configuration.rb
orchestration-0.6.11 lib/orchestration/services/rabbitmq/configuration.rb
orchestration-0.7.6 lib/orchestration/services/rabbitmq/configuration.rb
orchestration-0.6.10 lib/orchestration/services/rabbitmq/configuration.rb
orchestration-0.7.5 lib/orchestration/services/rabbitmq/configuration.rb
orchestration-0.7.4 lib/orchestration/services/rabbitmq/configuration.rb
orchestration-0.6.9 lib/orchestration/services/rabbitmq/configuration.rb
orchestration-0.6.8 lib/orchestration/services/rabbitmq/configuration.rb