Skip to content

Commit

Permalink
minor bug fixes in amqp adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
rabbitt committed May 14, 2010
1 parent 0d8989d commit 6507737
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/activemessaging/adapters/amqp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -180,7 +180,7 @@ def initialize(data, queue_name = nil)

def headers
super.merge({
:destination => @destination,
:destination => routing_key,
:delivery_tag => @delivery_tag
})
end
Expand All @@ -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)
Expand Down

0 comments on commit 6507737

Please sign in to comment.