Sha256: c2026d83e24c4f7b277582895fdaa45a629ddea8864b29abbb34691645ec6963

Contents?: true

Size: 744 Bytes

Versions: 86

Compression:

Stored size: 744 Bytes

Contents

class GorbyPuffSubscriber < ActionSubscriber::Base
  at_least_once!

  def grumpy
    $messages << "#{payload}::#{$messages.size}"
    raise RuntimeError.new("what do I do now?") unless $messages.size > 2
  end
end

describe "at_least_once! mode", :integration => true do
  let(:draw_routes) do
    ::ActionSubscriber.draw_routes do
      default_routes_for GorbyPuffSubscriber
    end
  end
  let(:subscriber) { GorbyPuffSubscriber }

  it "retries a failed job until it succeeds" do
    ::ActionSubscriber.start_subscribers!
    ::ActivePublisher.publish("gorby_puff.grumpy", "GrumpFace", "events")

    verify_expectation_within(2.0) do
      expect($messages).to eq Set.new(["GrumpFace::0","GrumpFace::1","GrumpFace::2"])
    end
  end
end

Version data entries

86 entries across 86 versions & 1 rubygems

Version Path
action_subscriber-5.3.3-java spec/integration/at_least_once_spec.rb
action_subscriber-5.3.3 spec/integration/at_least_once_spec.rb
action_subscriber-5.3.2-java spec/integration/at_least_once_spec.rb
action_subscriber-5.3.2 spec/integration/at_least_once_spec.rb
action_subscriber-5.3.1-java spec/integration/at_least_once_spec.rb
action_subscriber-5.3.1 spec/integration/at_least_once_spec.rb
action_subscriber-5.3.1.pre-java spec/integration/at_least_once_spec.rb
action_subscriber-5.3.1.pre spec/integration/at_least_once_spec.rb
action_subscriber-5.3.0-java spec/integration/at_least_once_spec.rb
action_subscriber-5.3.0 spec/integration/at_least_once_spec.rb
action_subscriber-5.2.4-java spec/integration/at_least_once_spec.rb
action_subscriber-5.2.4 spec/integration/at_least_once_spec.rb
action_subscriber-5.2.3-java spec/integration/at_least_once_spec.rb
action_subscriber-5.2.3 spec/integration/at_least_once_spec.rb
action_subscriber-5.2.2-java spec/integration/at_least_once_spec.rb
action_subscriber-5.2.2 spec/integration/at_least_once_spec.rb
action_subscriber-5.2.1-java spec/integration/at_least_once_spec.rb
action_subscriber-5.2.1 spec/integration/at_least_once_spec.rb
action_subscriber-5.2.0-java spec/integration/at_least_once_spec.rb
action_subscriber-5.2.0 spec/integration/at_least_once_spec.rb