How to catch the error in delivery and mark the delivery as "Undelivered". So that it should not retry the delivery.
For one of my Receipt render service it throws timeout error sometimes and I want the delivery with same error to stop immediately from retrying. SO that it should not impact the server performance.
Hi Ankit, would the following result from your delivery service do the trick?
return new DeliveryResultBuilder() .setMaxDeliveryAttempts(1) .setMessage("Render receipt timeout") .setStatus("Error") .build()
The transaction should stay in the Error delivery status however no delivery retry should occur (my guess). Maybe try to use
Generally, you dont want to set the transaction to the Undeliverable delivery status as that failure might never be picked up. If it stays in the Error status, it'l be picked up as part of the delivery error submissions alert email.
See more details here
Thanks Miro, I have tried the same solution but still it keeps on trying when error occurs. Also I have analyzed that the attempt behavior is similar as mentioned for render receipt below somewhere in documentation.
Still not sure if adding the delivery service in background will work for Render receipt or not. Or need to find some other solution.