Sha256: 05c5e228461aff13851a4bca410b2d0130a4b5fd999319db104b58958519ff7d

Contents?: true

Size: 1020 Bytes

Versions: 17

Compression:

Stored size: 1020 Bytes

Contents

require "spec_helper"

unless ENV["CI"]
  describe Bunny::Channel, "#basic_publish" do
    before :all do
      @connection = Bunny.new(:user     => "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

17 entries across 17 versions & 1 rubygems

Version Path
bunny-2.6.3 spec/issues/issue100_spec.rb
bunny-2.6.2 spec/issues/issue100_spec.rb
bunny-2.6.1 spec/issues/issue100_spec.rb
bunny-2.6.0 spec/issues/issue100_spec.rb
bunny-2.5.1 spec/issues/issue100_spec.rb
bunny-2.5.0 spec/issues/issue100_spec.rb
bunny-2.4.0 spec/issues/issue100_spec.rb
bunny-2.3.1 spec/issues/issue100_spec.rb
bunny-2.3.0 spec/issues/issue100_spec.rb
bunny-2.2.2 spec/issues/issue100_spec.rb
bunny-2.2.1 spec/issues/issue100_spec.rb
bunny-2.2.0 spec/issues/issue100_spec.rb
bunny-2.1.0 spec/issues/issue100_spec.rb
bunny-2.0.1 spec/issues/issue100_spec.rb
bunny-2.0.0 spec/issues/issue100_spec.rb
bunny-2.0.0.rc2 spec/issues/issue100_spec.rb
bunny-2.0.0.rc1 spec/issues/issue100_spec.rb