How do you handle unique reference if it fails in the queue?

I have a reference of email and course name. However there are instances that it fails on the queue when it encounters a business exception or system exception. So my question is how do you handle your unique references, that still enables you to add to the queue item if the status is failed in the queue?

Try retry option in reframework. Queue should be set to retry failed items X times.

In the queue you can also use retry option on failed items.

Other option. You can do your own check when creating a queue.
Set queue with unique references disabled.
Then, when creating a queue for each mail use activity get queue items. Use filtering for new, inProgress or successful items. In the filter place your refence pattern and setting equals to.

Then you should have if with condition: output_items.count=0

Then: add this item to the queue
Else: nothing or log that this is duplicate.

So each time if you will have item that was proceed in the queue and it was failed it could be added one more time because queue doesnt block you anymore, but you will have still the condition to skip adding items that were successful or they are new.

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.