The errors are sorted in chronological order (order to newer).
To add error message, we stopped using dead letter exchange on worker queue. You need to reset existing queues after this change because of that.
We still use dead letter exchange on retry queue. However it no longer has expiration time on queue layer and it's set to each messages. It will allow us to write more complicated retry logic like this in future.
Only thing is: the inclusion of the pid is dubious. The pid is not shared over instances and seems language specific. (On the other hand it also doesn't hurt.)
We would like to add failed logs to the message so it helps identifying issue instantly.
Here is the example message.
The errors are sorted in chronological order (order to newer).
To add error message, we stopped using dead letter exchange on worker queue. You need to reset existing queues after this change because of that.
We still use dead letter exchange on retry queue. However it no longer has expiration time on queue layer and it's set to each messages. It will allow us to write more complicated retry logic like this in future.