Class: AwsSqsMoniter::DeadLetters::Worker

Inherits:
Object
  • Object
show all
Includes:
Shoryuken::Worker
Defined in:
lib/aws_sqs_moniter/dead_letters/worker.rb

Instance Method Summary collapse

Instance Method Details

#perform(sqs_message, payload) ⇒ Object



22
23
24
25
26
27
28
29
30
31
# File 'lib/aws_sqs_moniter/dead_letters/worker.rb', line 22

def perform sqs_message, payload
  typed_message = TypedMessage.new sqs_message

  return if DeadLetter.exists? message_id: typed_message.id

  DeadLetter.create!(
    sqs_id: sqs_message.message_id,
    message_id: typed_message.id,
    message: payload)
end