Class: QProcessor::SQSMessage

Inherits:
Message
  • Object
show all
Defined in:
lib/qprocessor/sqs_message.rb

Instance Attribute Summary

Attributes inherited from Message

#source

Instance Method Summary collapse

Methods inherited from Message

#body, #release

Constructor Details

#initialize(source, client, queue_url) ⇒ SQSMessage

Returns a new instance of SQSMessage.



5
6
7
8
9
# File 'lib/qprocessor/sqs_message.rb', line 5

def initialize(source, client, queue_url)
  super(source)
  @client    = client
  @queue_url = queue_url
end

Instance Method Details

#disposeObject

Deletes a message from the source queue.



12
13
14
# File 'lib/qprocessor/sqs_message.rb', line 12

def dispose
  @client.delete_message(queue_url: @queue_url, receipt_handle: source.receipt_handle)
end

#idObject

Retrieves the message identifier.



17
18
19
# File 'lib/qprocessor/sqs_message.rb', line 17

def id
  source.message_id
end