I have a transaction item in queue and if it fails i need to mark it as failed status and then pick it up in the next run (run happens every 5 mins). I need it to retry only 3 times (in different runs, not retry 3 times in the same run) and after that it should not be picked up again. For this purpose, want to understand if there is a way to fetch the current retry count from queue and update the current count back to orchestrator?
Is there a reason why it can’t be retried in current run? What you want is possible, but it would way easier to let the retries happen automatically by queue retry mechanism. If you still want to go for it, I think it could be handled by a combination of Postpone transaction item & Set transaction progress:
Before adding a transaction to queue, check with Get Queue Items if the item has been added earlier or not (filter with reference field), or enforce unique references in the queue.
When a transaction item is failed:
Check current retry number from Progress field. If all retries are used, set the transaction status to failed.
Else postpone it by a sufficient amount, so it won’t be picked up in the current run.
Update the current retry number to the progress field with Set progress activity.
Thanks for the reply. Yes there is a reason why i cannot retry immediately as there are other dependencies that might make it success after some time. If we are using set transaction progress will we be able to see from orchestrator how many times it retried. As we need a report at the end of the day how many times which transaction retried.
Iam able to use set transaction in progress activity once. In the second run it is throwing " Set Transaction Progress: Object reference not set to an instance of an object."when i want to add the second retry coun t.
instead of progress and all simply when the item fails add a new item with same data but increment the retry number which will be a item in your specific content and give a postponed time so that it is not picked in same run and also next time you can check the retrynumber count again from specific content and either add item again or end as max retry reached
The progress can be updated as many times as needed. And to get the current progress, we can use trItem.Progress. So for incrementing it, assuming we just store the retry number in the Progress: