Class: TorqueBox::Messaging::ProcessorMiddleware::WithTransaction

Inherits:
Object
  • Object
show all
Defined in:
lib/torquebox/messaging/processor_middleware/with_transaction.rb

Instance Method Summary collapse

Instance Method Details

#call(session, message) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/torquebox/messaging/processor_middleware/with_transaction.rb', line 25

def call(session, message)
  if session
    begin
      TorqueBox.transaction( session ) { yield }
    rescue Exception => ex
      $stderr.puts("Unable to process inbound message", ex)
    end
  else
    yield
  end
end