Sha256: 34318d455bba711cf126c63aab186da1adbcadbc565c1132790c41f83126ad15
Contents?: true
Size: 1.32 KB
Versions: 3
Compression:
Stored size: 1.32 KB
Contents
# frozen_string_literal: true module Basquiat module Adapters class RabbitMq # 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 class Message < Basquiat::Adapters::BaseMessage attr_reader :delivery_info, :props alias 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 @routing_key || delivery_info.routing_key end # Shorthand for delivery_info.delivery_tag # @return [String] the message's Delivery Tag def delivery_tag delivery_info.delivery_tag end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
basquiat-1.3.2 | lib/basquiat/adapters/rabbitmq/message.rb |
basquiat-1.3.1 | lib/basquiat/adapters/rabbitmq/message.rb |
basquiat-1.3.0 | lib/basquiat/adapters/rabbitmq/message.rb |