mrC
October 20, 2019, 12:52am
1
Hello,
I’m trying to configure a dead letter queue for a particular queue:
sqs_event(:generate_queue,
queue_properties: {
redrive_policy: {
deadLetterTargetArn: ref(:shared_queue_name),
maxReceiveCount: 3
}.to_json
}
)
def analysis
puts "analysis job called"
end
I’ve also tried other variants, but nothing works – the deploy fails and the rollback happens.
tung
October 20, 2019, 5:28am
2
The .to_json
shouldn’t be there. Unsure if you have other things like depends_on
and a configured timeout that is less than the SQS queue default timeout per docs Jets SQS Event
Here’s a working jets project example: tongueroo/jets-sqs-dead-letter
mrC
October 20, 2019, 6:44am
3
That worked perfect. Thank you for opening an example repo. Do you recommend having a dlq for every simple queue? Or share it across different queues?
mrC
October 20, 2019, 7:50pm
5
@tung It seems that is not possible to reference a shared queue that uses a dead letter queue, e.g:
# ...
sqs_event(ref(:shared_queue_name),
queue_properties: {
redrive_policy: {
dead_letter_target_arn: ref(:dead_letter),
max_receive_count: 3,
}})
def run
puts "!"
end
# ...
If I try to generate a queue by replacing ref(:shared_queue_name)
with :generate_queue
, the deploy succeeds.