Class: ActiveMessaging::Adapters::Sqs::Message
- Inherits:
-
BaseMessage
- Object
- BaseMessage
- ActiveMessaging::Adapters::Sqs::Message
- Defined in:
- lib/activemessaging/adapters/sqs.rb
Overview
based on stomp message, has pointer to the SQSResponseObject
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#md5_of_body ⇒ Object
Returns the value of attribute md5_of_body.
-
#queue ⇒ Object
Returns the value of attribute queue.
-
#receipt_handle ⇒ Object
Returns the value of attribute receipt_handle.
-
#request_id ⇒ Object
Returns the value of attribute request_id.
-
#response ⇒ Object
Returns the value of attribute response.
Attributes inherited from BaseMessage
#body, #destination, #headers, #id
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(body, headers, id, md5_of_body, receipt_handle, attributes, response, queue) ⇒ Message
constructor
A new instance of Message.
- #to_s ⇒ Object
Methods inherited from BaseMessage
Constructor Details
#initialize(body, headers, id, md5_of_body, receipt_handle, attributes, response, queue) ⇒ Message
Returns a new instance of Message.
479 480 481 482 |
# File 'lib/activemessaging/adapters/sqs.rb', line 479 def initialize body, headers, id, md5_of_body, receipt_handle, attributes, 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
#attributes ⇒ Object
Returns the value of attribute attributes.
462 463 464 |
# File 'lib/activemessaging/adapters/sqs.rb', line 462 def attributes @attributes end |
#md5_of_body ⇒ Object
Returns the value of attribute md5_of_body.
462 463 464 |
# File 'lib/activemessaging/adapters/sqs.rb', line 462 def md5_of_body @md5_of_body end |
#queue ⇒ Object
Returns the value of attribute queue.
462 463 464 |
# File 'lib/activemessaging/adapters/sqs.rb', line 462 def queue @queue end |
#receipt_handle ⇒ Object
Returns the value of attribute receipt_handle.
462 463 464 |
# File 'lib/activemessaging/adapters/sqs.rb', line 462 def receipt_handle @receipt_handle end |
#request_id ⇒ Object
Returns the value of attribute request_id.
462 463 464 |
# File 'lib/activemessaging/adapters/sqs.rb', line 462 def request_id @request_id end |
#response ⇒ Object
Returns the value of attribute response.
462 463 464 |
# File 'lib/activemessaging/adapters/sqs.rb', line 462 def response @response end |
Class Method Details
.from_element(e, response, queue) ⇒ Object
464 465 466 467 468 469 470 471 472 473 474 475 476 477 |
# File 'lib/activemessaging/adapters/sqs.rb', line 464 def self.from_element(e, response, queue) attributes = {} e.elements.each('Attribute') { |n| attributes[n.elements['Name'].text] = n.elements['Value'].text } Message.new( e.elements['Body'].text, response.headers, e.elements['MessageId'].text, e.elements['MD5OfBody'].text, e.elements['ReceiptHandle'].text, attributes, response, queue) end |
Instance Method Details
#to_s ⇒ Object
484 485 486 |
# File 'lib/activemessaging/adapters/sqs.rb', line 484 def to_s "<AmazonSQS::Message id='#{id}' body='#{body}' headers='#{headers.inspect}' attributes='#{attributes.inspect}' response='#{response}'>" end |