Class: ActiveMessaging::Adapters::AmazonSqs::Message

Inherits:
BaseMessage
  • Object
show all
Defined in:
lib/activemessaging/adapters/asqs.rb

Overview

based on stomp message, has pointer to the SQSResponseObject

Instance Attribute Summary collapse

Attributes inherited from BaseMessage

#body, #destination, #headers, #id

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseMessage

#dup, #matches_subscription?

Constructor Details

#initialize(body, headers, id, md5_of_body, receipt_handle, response, queue) ⇒ Message

Returns a new instance of Message.



475
476
477
478
# File 'lib/activemessaging/adapters/asqs.rb', line 475

def initialize body, headers, id, md5_of_body, receipt_handle, response, queue
  super(body, id, headers, queue.name)
  @md5_of_body, @receipt_handle, @response, @queue =  md5_of_body, receipt_handle, response, queue
end

Instance Attribute Details

#md5_of_bodyObject

Returns the value of attribute md5_of_body.



469
470
471
# File 'lib/activemessaging/adapters/asqs.rb', line 469

def md5_of_body
  @md5_of_body
end

#queueObject

Returns the value of attribute queue.



469
470
471
# File 'lib/activemessaging/adapters/asqs.rb', line 469

def queue
  @queue
end

#receipt_handleObject

Returns the value of attribute receipt_handle.



469
470
471
# File 'lib/activemessaging/adapters/asqs.rb', line 469

def receipt_handle
  @receipt_handle
end

#responseObject

Returns the value of attribute response.



469
470
471
# File 'lib/activemessaging/adapters/asqs.rb', line 469

def response
  @response
end

Class Method Details

.from_element(e, response, queue) ⇒ Object



471
472
473
# File 'lib/activemessaging/adapters/asqs.rb', line 471

def self.from_element e, response, queue
  Message.new(e.elements['Body'].text, response.headers, e.elements['MessageId'].text, e.elements['MD5OfBody'].text, e.elements['ReceiptHandle'].text, response, queue)
end

Instance Method Details

#to_sObject



480
481
482
# File 'lib/activemessaging/adapters/asqs.rb', line 480

def to_s
  "<AmazonSQS::Message id='#{id}' body='#{body}' headers='#{headers.inspect}' response='#{response}'>"
end