Sha256: 8fe18b11cafae49b73944a95baaf0f0b14d6807497e699712512375e113a06c1

Contents?: true

Size: 998 Bytes

Versions: 51

Compression:

Stored size: 998 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

unless ENV["CI"]
  describe "Message acknowledgements" do

    #
    # Environment
    #

    include EventedSpec::AMQPSpec

    default_timeout 120

    amqp_before do
      @connection = AMQP.connect
      @channel1   = AMQP::Channel.new(@connection)
      @channel2   = AMQP::Channel.new(@connection)
    end


    it "can be issued for delivery tags >= 192" do
      exchange_name = "amqpgem.tests.fanout#{rand}"
      queue         = @channel1.queue("", :auto_delete => true).bind(exchange_name).subscribe(:ack => true) do |metadata, payload|
        puts "x-sequence = #{metadata.headers['x-sequence']}, delivery_tag = #{metadata.delivery_tag}" if ENV["DEBUG"]
        metadata.ack
        if metadata.delivery_tag >= 999
          done(1.0)
        end
      end

      exchange = @channel2.fanout(exchange_name, :durable => false)
      2000.times do |i|
        exchange.publish("", :headers => { 'x-sequence' => i })
      end
    end
  end  
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
amqp-1.8.0 spec/integration/message_acknowledgement_spec.rb
amqp-1.7.0 spec/integration/message_acknowledgement_spec.rb
amqp-1.6.0 spec/integration/message_acknowledgement_spec.rb
amqp-1.5.3 spec/integration/message_acknowledgement_spec.rb
amqp-1.5.2 spec/integration/message_acknowledgement_spec.rb
amqp-1.5.1 spec/integration/message_acknowledgement_spec.rb
amqp-1.5.0 spec/integration/message_acknowledgement_spec.rb
amqp-1.4.2 spec/integration/message_acknowledgement_spec.rb
amqp-1.4.1 spec/integration/message_acknowledgement_spec.rb
amqp-1.4.0 spec/integration/message_acknowledgement_spec.rb
amqp-1.3.0 spec/integration/message_acknowledgement_spec.rb
amqp-1.2.1 spec/integration/message_acknowledgement_spec.rb
amqp-1.2.0 spec/integration/message_acknowledgement_spec.rb
amqp-1.1.8 spec/integration/message_acknowledgement_spec.rb
amqp-1.1.7 spec/integration/message_acknowledgement_spec.rb
amqp-1.1.6 spec/integration/message_acknowledgement_spec.rb
amqp-1.1.5 spec/integration/message_acknowledgement_spec.rb
amqp-1.1.4 spec/integration/message_acknowledgement_spec.rb
amqp-1.1.3 spec/integration/message_acknowledgement_spec.rb
amqp-1.0.4 spec/integration/message_acknowledgement_spec.rb