I am using REFramework to process queue items, where each queue item represents an application. Since I have 7 applications that must be processed sequentially, I need immediate retries for System Exceptions. Currently, when a System Exception occurs, the queue item is retried only at the end of the queue. Instead, I want the same application to be retried immediately before the framework proceeds to the next queue item.
Hi @ashishmani,
You can implement the retry logic directly in the Process State.
- Use a Try-Catch block.
- Add a Retry Scope inside the Try section.
- Move your
Process.xamlcode into the Action section of the Retry Scope. - In the Catch block, log the InnerException and Exception details.
Alternatively, you can store a reference to the current TransactionItem and, in the Get Transaction Data state, check whether that if queue item is available in New status with this reference. If it is, retrieve that item ; otherwise, proceed with the normal Get Transaction Item logic.
Thanks!
You can use the Retry activity on each action and set the retry count as needed.
You can use the Kill Process activity on every retry, and relogin before each retry. All this done within your process.xaml itself.
You can also combine try-catch here and update a flag indicating whether the step was successful or not, to determine the retry logic.
Here is a quick flow to better visualize the process.
Hi @ashishmani,
Loop back to Process State Machine immediately instead of going to GetTransactionData State Machine in case of a System Exception.
- Add a counter io_RetryNumber and reset it to 0 after each new item is fetched in GetTransactionData State Machine.
- Whenever
Process.xaml, catches System Exception then increment io_RetryNumber. - Upon System Exception, check if
io_RetryNumber < MaxRetryNumberthen go back toProcess.xamlwith the same in_TransactionItem (skipGetTransactionData). ElseSetTransactionStatus(Failed) which goes back toGetTransactionData. - Don’t call
SetTransactionStatusuntil retries are exhausted. Calling it early hands the item back to Orchestrator’s own retry cycle, which is what you’re trying to avoid. - Set the queue’s Orchestrator-level max retries to 1, otherwise you get double retries (yours + Orchestrator’s).
- If the exception implies a broken session/app (not just a transient error), route the retry to
InitAllApplicationsinstead of straight toProcess.
I hope this helps.
Cheers!
The easiest fix is to just wrap your logic inside Process.xaml with a Retry Scope activity. Set NumberOfRetries to 3 (or whatever you need). That way, if a system exception hits, it retries right then and there locally before REFramework even knows it failed. Just make sure to turn off retries on the Orchestrator queue itself (set Max Retries to 0) so it doesn’t try to retry it again later.
@ashishmani this is the easiest and quickest approach.
Hi @ashishmani
For immediate retry, handle it inside Process Transaction instead of relying on Orchestrator retry.
Flow:
Get Queue Item → Process → System Exception → Retry same item → Success → Next item
Use a retry counter (e.g., max 3 attempts). This way, the same application is retried immediately before moving to the next queue item.
@ashishmani I’ll also recommend this approach, this one will be best.
