Sha256: f0bf8d0cc58e703ce6431472df7b62e45f37aa0b7774b9fc422150898a8b3bf7

Contents?: true

Size: 726 Bytes

Versions: 13

Compression:

Stored size: 726 Bytes

Contents

module RabbitMQ
  module Toxiproxy
    RABBITMQ_UPSTREAM_HOST = if !ENV["LOCAL_RABBITMQ"].nil?
                               # a local Toxiproxy/RabbitMQ combination
                               "localhost"
                             else
                               # docker-compose
                               "rabbitmq"
                             end

    def setup_toxiproxy
      ::Toxiproxy.populate([{
        name: "rabbitmq",
        listen: "0.0.0.0:11111",
            upstream: "#{RABBITMQ_UPSTREAM_HOST}:5672"
      }])
      rabbitmq_toxiproxy.enable
    end

    def cleanup_toxiproxy
      ::Toxiproxy.populate()
    end

    def rabbitmq_toxiproxy
      ::Toxiproxy[/rabbitmq/]
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
bunny-2.19.0 spec/toxiproxy_helper.rb
bunny-2.18.0 spec/toxiproxy_helper.rb
bunny-2.17.0 spec/toxiproxy_helper.rb
bunny-2.16.1 spec/toxiproxy_helper.rb
bunny-2.15.0 spec/toxiproxy_helper.rb
bunny-2.14.4 spec/toxiproxy_helper.rb
bunny-2.14.3 spec/toxiproxy_helper.rb
bunny-2.14.2 spec/toxiproxy_helper.rb
bunny-2.14.1 spec/toxiproxy_helper.rb
bunny-2.13.0 spec/toxiproxy_helper.rb
bunny-2.12.1 spec/toxiproxy_helper.rb
bunny-2.12.0 spec/toxiproxy_helper.rb
bunny-2.12.0.rc1 spec/toxiproxy_helper.rb