Sha256: 511078b876a62ac1cc1955a76a507c789a3ed7622f1bb27e0cbd02781c835ca8

Contents?: true

Size: 970 Bytes

Versions: 9

Compression:

Stored size: 970 Bytes

Contents

require "spec_helper"

unless ENV["CI"]
  describe Bunny::Channel, "#basic_publish" do
    let(:connection) do
      c = Bunny.new(:user     => "bunny_gem",
                    :password => "bunny_password",
                    :vhost    => "bunny_testbed",
                    :write_timeout => 0,
                    :read_timeout => 0)
      c.start
      c
    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

9 entries across 9 versions & 1 rubygems

Version Path
bunny-1.7.1 spec/issues/issue100_spec.rb
bunny-1.7.0 spec/issues/issue100_spec.rb
bunny-1.6.3 spec/issues/issue100_spec.rb
bunny-1.6.2 spec/issues/issue100_spec.rb
bunny-1.6.1 spec/issues/issue100_spec.rb
bunny-1.6.0 spec/issues/issue100_spec.rb
bunny-1.6.0.rc2 spec/issues/issue100_spec.rb
bunny-1.6.0.rc1 spec/issues/issue100_spec.rb
bunny-1.6.0.pre1 spec/issues/issue100_spec.rb