Skip to content

Commit

Permalink
Add delivery_info to properties for error handler
Browse files Browse the repository at this point in the history
When handling an error, it would be useful to know the delivery_info such as the routing key. This adds delivery_info to message properties. This seemed the only way to supply the information without changing the error handler contract.
  • Loading branch information
tlloydthwaites committed Jul 4, 2023
1 parent 544b23b commit 9701d67
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/hutch/worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def handle_message(consumer, delivery_info, properties, payload)
@broker.ack(delivery_info.delivery_tag) unless consumer_instance.message_rejected?
rescue => ex
acknowledge_error(delivery_info, properties, @broker, ex)
properties = Bunny::MessageProperties.new(properties.to_hash.merge(delivery_info: delivery_info))
handle_error(properties, payload, consumer, ex)
end

Expand Down

0 comments on commit 9701d67

Please sign in to comment.