From 6507737d6c9390d2933ac0b797354d9f841f6dfd Mon Sep 17 00:00:00 2001 From: "Carl P. Corliss" Date: Fri, 14 May 2010 01:23:23 -0400 Subject: [PATCH] minor bug fixes in amqp adapter --- lib/activemessaging/adapters/amqp.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/activemessaging/adapters/amqp.rb b/lib/activemessaging/adapters/amqp.rb index f03dbea..2c85e71 100644 --- a/lib/activemessaging/adapters/amqp.rb +++ b/lib/activemessaging/adapters/amqp.rb @@ -73,7 +73,7 @@ def receive message = queue.pop(:ack => true) unless message.nil? message = AmqpMessage.decode(message).stamp_received! unless message.nil? - message.headers[:delivery_tag] = queue.delivery_tag + message.delivery_tag = queue.delivery_tag puts "RECEIVE: #{message.inspect}" if @debug return message end @@ -180,7 +180,7 @@ def initialize(data, queue_name = nil) def headers super.merge({ - :destination => @destination, + :destination => routing_key, :delivery_tag => @delivery_tag }) end @@ -190,7 +190,7 @@ def matches_subscription?(subscription) destination = subscription.subscribe_headers[:routing_key] || subscription.destination.value.to_s if destination.match(/(\#|\*)/) - dest_regex = Regex.new(destination.gsub('.*', '[.][^.]+').gsub(/\.\#.*/, '[.].*')) + dest_regex = ::Regexp.new(destination.gsub('.*', '[.][^.]+').gsub(/\.\#.*/, '[.].*')) !!(headers[:destination].to_s =~ dest_regex) else !!(headers[:destination].to_s == destination)