class Basquiat::Adapters::RabbitMq::Message
A RabbitMQ message, with it's delivery info and properties It's used instead of a simple hash so we can access more easily the properties needed for acks and requeues
Attributes
delivery_info[R]
di[R]
props[R]
routing_key[W]
@!attribute [rw] routing_key
It overrides (but not overwrites) the delivery_info routing_key @return [String] returns either the set routing_key or the delivery_info routing_key
Public Class Methods
new(message, delivery_info = {}, props = {})
click to toggle source
@!attribute [r] delivery_info
@return [Hash] RabbitMQ delivery_info.
@!attribute [r] props
@return [Hash] RabbitMQ message properties, such as headers.
Calls superclass method
Basquiat::Adapters::BaseMessage::new
# File lib/basquiat/adapters/rabbitmq/message.rb, line 17 def initialize(message, delivery_info = {}, props = {}) super(message) @delivery_info = delivery_info @props = props @action = :ack end
Public Instance Methods
delivery_tag()
click to toggle source
Shorthand for delivery_info.delivery_tag @return [String] the message's Delivery Tag
# File lib/basquiat/adapters/rabbitmq/message.rb, line 34 def delivery_tag delivery_info.delivery_tag end
routing_key()
click to toggle source
# File lib/basquiat/adapters/rabbitmq/message.rb, line 28 def routing_key @routing_key || delivery_info.routing_key end