I am using the REFramework but I want to configure it to send email when a System Exception is encountered - but only if it’s done retrying (or not retrying at all) which is based on the configuration of the queue.
For example:
Get Next Item from Queue - Transaction T1
Transaction T1 encounters a System Exception
Queue item Transaction T1 is marked as retried and a new (same) queue item is created to process later as the queue is configured to retry 2 times
Repeat steps 1-3 until it gets to the queue item is actually a retry of Transaction T1
After the 2nd retry and stills encounters a System Exception, this is when I want to send email. Not when it will still do a retry
Now how do I incorporate that logic within the REFramework? Thanks!
Please try adding inside the Finally block of the Finally block of Process Transaction. I have added a comment indicating to invoke the workflow SendMail when System Error IsNot Nothing And RetryNumber greater than 1
Thanks GreenTea! This could potentially work but the “RetryNumber greater than 1” condition should be more like “RetryNumber greater than whatever the max retry configuration of the queue” which makes sense to put in Config.
Agree. I thought so too the solution would look like this. However, I was hoping for a way not needing to rely on the Config’s QueueMaxRetries is equal to Queue Max # of Retries setting of the Queue. Anyway, looks like this is the way to go. Thanks!
I think one more possibility is to get the max queue retry via Orchestrator API. The endpoint
/odata/QueueDefinitions should give back the necessary information directly from orchestrator queue.