Class: Rabbit::Receiving::Job

Inherits:
ActiveJob::Base
  • Object
show all
Defined in:
lib/rabbit/receiving/job.rb

Instance Method Summary collapse

Instance Method Details

#perform(message, arguments) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'lib/rabbit/receiving/job.rb', line 13

def perform(message, arguments)
  Lamian.run do
    message = Rabbit::Receiving::Message.build(message, arguments)
    handler = Rabbit::Receiving::HandlerResolver.handler_for(message)
    handler.new(message).call
  rescue Rabbit::Receiving::MalformedMessage => error
    raise if Rabbit.config.environment == :test
    Rabbit.config.exception_notifier.call(error)
  end
end