lib/basquiat/adapters/rabbitmq/message.rb in basquiat-1.2.0 vs lib/basquiat/adapters/rabbitmq/message.rb in basquiat-1.3.0.pre.1
- old
+ new
@@ -2,31 +2,32 @@
module Adapters
class RabbitMq
class Message < Basquiat::Adapters::BaseMessage
attr_reader :delivery_info, :props
alias_method :di, :delivery_info
+ # @!attribute [r] delivery_info
+ # @return [Hash] RabbitMQ delivery_info.
+ # @!attribute [r] props
+ # @return [Hash] RabbitMQ message properties, such as headers.
def initialize(message, delivery_info = {}, props = {})
super(message)
@delivery_info = delivery_info
@props = props
@action = :ack
end
+ # @!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
+ attr_writer :routing_key
def routing_key
- delivery_info.routing_key
+ @routing_key || delivery_info.routing_key
end
+ # Shorthand for delivery_info.delivery_tag
def delivery_tag
delivery_info.delivery_tag
- end
-
- def ack
- @action = :ack
- end
-
- def unack
- @action = :unack
end
end
end
end
end