Sha256: baf7e72b4dc4260b64fd20f3bc4684b2e7b53803e487907a312b44140480a8dd

Contents?: true

Size: 998 Bytes

Versions: 30

Compression:

Stored size: 998 Bytes

Contents

require "spec_helper"

unless ENV["CI"]
  describe Bunny::Channel, "#basic_publish" do
    before :all do
      @connection = Bunny.new(username: "bunny_gem",
                              password: "bunny_password",
                              vhost: "bunny_testbed",
                              write_timeout: 0,
                              read_timeout:  0)
      @connection.start
    end

    after :all do
      @connection.close if @connection.open?
    end


    context "when publishing thousands of messages" do
      let(:n) { 2_000 }
      let(:m) { 10 }

      it "successfully publishers them all" do
        ch = @connection.create_channel

        q  = ch.queue("", exclusive: true)
        x  = ch.default_exchange

        body = "x" * 1024
        m.times do |i|
          n.times do
            x.publish(body, routing_key:  q.name)
          end
          puts "Published #{i * n} 1K messages..."
        end

        q.purge
        ch.close
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
bunny-2.19.0 spec/issues/issue100_spec.rb
bunny-2.18.0 spec/issues/issue100_spec.rb
bunny-2.17.0 spec/issues/issue100_spec.rb
bunny-2.16.1 spec/issues/issue100_spec.rb
bunny-2.15.0 spec/issues/issue100_spec.rb
bunny-2.14.4 spec/issues/issue100_spec.rb
bunny-2.14.3 spec/issues/issue100_spec.rb
bunny-2.14.2 spec/issues/issue100_spec.rb
bunny-2.14.1 spec/issues/issue100_spec.rb
bunny-2.13.0 spec/issues/issue100_spec.rb
bunny-2.12.1 spec/issues/issue100_spec.rb
bunny-2.12.0 spec/issues/issue100_spec.rb
bunny-2.12.0.rc1 spec/issues/issue100_spec.rb
bunny-2.11.0 spec/issues/issue100_spec.rb
bunny-2.11.0.pre1 spec/issues/issue100_spec.rb
bunny-2.10.0 spec/issues/issue100_spec.rb
bunny-2.9.2 spec/issues/issue100_spec.rb
bunny-2.9.1 spec/issues/issue100_spec.rb
bunny-2.6.7 spec/issues/issue100_spec.rb
bunny-2.7.4 spec/issues/issue100_spec.rb