Emissary::Message
# File lib/activemessaging/adapters/amqp.rb, line 179 def initialize(data, queue_name = nil) data[:data] = data.delete(:body) unless (data[:data] && !data[:body]) super(data) @delivery_tag ||= (data[:headers][:delivery_tag] rescue nil) @destination ||= (data[:headers][:destination] rescue nil) || queue_name || routing_key @command = "MESSAGE" end
# File lib/activemessaging/adapters/amqp.rb, line 192 def headers super.merge({ :destination => routing_key, :delivery_tag => @delivery_tag }) end
# File lib/activemessaging/adapters/amqp.rb, line 199 def matches_subscription?(subscription) # use routing key first, otherwise, use the defined destination value destination = subscription.subscribe_headers[:routing_key] || subscription.destination.value.to_s if destination.match(/(\#|\*)/) dest_regex = ::Regexp.new(destination.gsub('.*', '[.][^.]+').gsub(/\.\#.*/, '[.].*')) !!(headers[:destination].to_s =~ dest_regex) else !!(headers[:destination].to_s == destination) end end
Generated with the Darkfish Rdoc Generator 2.