lib/mnemosyne/probes/msgr/consumer.rb in mnemosyne-ruby-1.1.0.rc1 vs lib/mnemosyne/probes/msgr/consumer.rb in mnemosyne-ruby-1.1.0
- old
+ new
@@ -14,13 +14,14 @@
module Instrumentation
def dispatch(message) # rubocop:disable AbcSize
route = message.route
metadata = message.metadata
+ headers = metadata.headers || {}
delivery_info = message.delivery_info
- origin = metadata.headers.delete('mnemosyne.origin')
- transaction = metadata.headers.delete('mnemosyne.transaction') do
+ origin = headers.delete('mnemosyne.origin')
+ transaction = headers.delete('mnemosyne.transaction') do
::SecureRandom.uuid
end
trace = ::Mnemosyne::Instrumenter.trace NAME,
transaction: transaction,