Class: Rabbitek::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/rabbitek/server/message.rb

Overview

A model representing message that consumer receives to process

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payload:, properties:, delivery_info:) ⇒ Message

Returns a new instance of Message.

Parameters:

  • payload (Hash)
  • properties (Bunny::MessageProperties)
  • delivery_info (Bunny::DeliveryInfo)


12
13
14
15
16
17
18
# File 'lib/rabbitek/server/message.rb', line 12

def initialize(payload:, properties:, delivery_info:)
  @payload = Utils::Oj.load(payload)
  @properties = properties
  @delivery_info = delivery_info

  @raw_payload = payload
end

Instance Attribute Details

#delivery_infoObject (readonly)

Returns the value of attribute delivery_info.



7
8
9
# File 'lib/rabbitek/server/message.rb', line 7

def delivery_info
  @delivery_info
end

#payloadObject (readonly)

Returns the value of attribute payload.



7
8
9
# File 'lib/rabbitek/server/message.rb', line 7

def payload
  @payload
end

#propertiesObject (readonly)

Returns the value of attribute properties.



7
8
9
# File 'lib/rabbitek/server/message.rb', line 7

def properties
  @properties
end

#raw_payloadObject (readonly)

Returns the value of attribute raw_payload.



7
8
9
# File 'lib/rabbitek/server/message.rb', line 7

def raw_payload
  @raw_payload
end