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.
467 468 469 470 |
# File 'lib/activemessaging/adapters/sqs.rb', line 467 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.
450 451 452 |
# File 'lib/activemessaging/adapters/sqs.rb', line 450 def attributes @attributes end |
#md5_of_body ⇒ Object
Returns the value of attribute md5_of_body.
450 451 452 |
# File 'lib/activemessaging/adapters/sqs.rb', line 450 def md5_of_body @md5_of_body end |
#queue ⇒ Object
Returns the value of attribute queue.
450 451 452 |
# File 'lib/activemessaging/adapters/sqs.rb', line 450 def queue @queue end |
#receipt_handle ⇒ Object
Returns the value of attribute receipt_handle.
450 451 452 |
# File 'lib/activemessaging/adapters/sqs.rb', line 450 def receipt_handle @receipt_handle end |
#request_id ⇒ Object
Returns the value of attribute request_id.
450 451 452 |
# File 'lib/activemessaging/adapters/sqs.rb', line 450 def request_id @request_id end |
#response ⇒ Object
Returns the value of attribute response.
450 451 452 |
# File 'lib/activemessaging/adapters/sqs.rb', line 450 def response @response end |
Class Method Details
.from_element(e, response, queue) ⇒ Object
452 453 454 455 456 457 458 459 460 461 462 463 464 465 |
# File 'lib/activemessaging/adapters/sqs.rb', line 452 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
472 473 474 |
# File 'lib/activemessaging/adapters/sqs.rb', line 472 def to_s "<AmazonSQS::Message id='#{id}' body='#{body}' headers='#{headers.inspect}' attributes='#{attributes.inspect}' response='#{response}'>" end |