Class: EventHub::Adapters::Aws::Message
- Inherits:
-
Message
- Object
- Message
- EventHub::Adapters::Aws::Message
- Defined in:
- lib/event_hub_aws/adapters/aws/message.rb
Instance Method Summary collapse
- #ack ⇒ Object
- #attributes ⇒ Object
- #body ⇒ Object
- #event ⇒ Object
-
#initialize(adapter, message) ⇒ Message
constructor
A new instance of Message.
- #reject ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(adapter, message) ⇒ Message
Returns a new instance of Message.
7 8 9 10 |
# File 'lib/event_hub_aws/adapters/aws/message.rb', line 7 def initialize(adapter, ) @adapter = adapter = end |
Instance Method Details
#ack ⇒ Object
28 29 30 31 |
# File 'lib/event_hub_aws/adapters/aws/message.rb', line 28 def ack # Delete the message from the queue. @adapter.(.receipt_handle) end |
#attributes ⇒ Object
12 13 14 |
# File 'lib/event_hub_aws/adapters/aws/message.rb', line 12 def attributes @attributes ||= parsed_body['MessageAttributes'].transform_values { |v| v['Value'] } end |
#body ⇒ Object
16 17 18 |
# File 'lib/event_hub_aws/adapters/aws/message.rb', line 16 def body parsed_body['Message'] end |
#event ⇒ Object
20 21 22 |
# File 'lib/event_hub_aws/adapters/aws/message.rb', line 20 def event attributes['event'] end |
#reject ⇒ Object
33 34 35 36 37 |
# File 'lib/event_hub_aws/adapters/aws/message.rb', line 33 def reject ack if @adapter.config[:delete_message_on_failure] # other wise it will be returned to the main queue and then after the maxReceiveCount it will be sent to # the DeadLetter queue end |
#version ⇒ Object
24 25 26 |
# File 'lib/event_hub_aws/adapters/aws/message.rb', line 24 def version attributes['version'] end |