lib/sqewer/connection.rb in sqewer-6.0.6 vs lib/sqewer/connection.rb in sqewer-6.1.0

- old
+ new

@@ -12,11 +12,11 @@ MAX_RANDOM_RECEIVE_FAILURES = 100 # sure to hit the max_elapsed_time of 900 seconds NotOurFaultAwsError = Class.new(StandardError) # A wrapper for most important properties of the received message - class Message < Struct.new(:receipt_handle, :body) + class Message < Struct.new(:receipt_handle, :body, :attributes) def inspect body.inspect end def has_body? @@ -55,10 +55,10 @@ # @return [Array<Message>] an array of Message objects def receive_messages Retriable.retriable on: Seahorse::Client::NetworkingError, tries: MAX_RANDOM_RECEIVE_FAILURES do response = client.receive_message(queue_url: @queue_url, wait_time_seconds: DEFAULT_TIMEOUT_SECONDS, max_number_of_messages: BATCH_RECEIVE_SIZE) - response.messages.map {|message| Message.new(message.receipt_handle, message.body) } + response.messages.map {|message| Message.new(message.receipt_handle, message.body, message.attributes) } end end # Send a message to the backing queue #