Sha256: 0779193b9bb00261e74bcedf5a5f4983275dcf46bec62d2b621b410df2682956
Contents?: true
Size: 870 Bytes
Versions: 42
Compression:
Stored size: 870 Bytes
Contents
class BaconSubscriber < ActionSubscriber::Base manual_acknowledgement! def served $messages << "#{payload}::#{$messages.size}" if $messages.size > 3 acknowledge elsif $messages.size > 2 nack else reject end end end describe "Manual Message Acknowledgment", :integration => true do let(:connection) { subscriber.connection } let(:draw_routes) do ::ActionSubscriber.draw_routes do default_routes_for BaconSubscriber end end let(:subscriber) { BaconSubscriber } it "retries rejected/nacked messages and stops retrying acknowledged messages" do ::ActionSubscriber.start_subscribers! ::ActivePublisher.publish("bacon.served", "BACON!", "events") verify_expectation_within(2.5) do expect($messages).to eq(Set.new(["BACON!::0", "BACON!::1", "BACON!::2", "BACON!::3"])) end end end
Version data entries
42 entries across 42 versions & 1 rubygems