lib/ears/middlewares/max_retries.rb in ears-0.7.1 vs lib/ears/middlewares/max_retries.rb in ears-0.7.2
- old
+ new
@@ -28,9 +28,11 @@
.publish(payload, routing_key: error_queue)
:ack
end
def retries_exceeded?(metadata)
+ return false if metadata.headers.nil?
+
rejected_deaths =
metadata
.headers
.fetch('x-death', [])
.select { |death| death['reason'] == 'rejected' }