Posted: 25 Sep 2020 11:01 EDT Last activity: 17 Nov 2020 22:01 EST
Getting notified for Broken Queue items
I have a standard agent configured in my application with maxattempts as 3. I want whenever 3 attempts are exhausted and item is moving to broken-queue then an email notification should be sent out with error details.
How can i achieve that?
Also second question is that whenever a queue item is moving to Broken queue......does pega logs anything is pega logs to identify the error why the item is moving to broken queue?
If you analyze the broken queue, you will find the property pyAttemp. Now, you can have a advance agent on that particular class. The advance agent will iterate through the queue class and if the attmept is 3 and pyItemstatus is Broken-Process, you can get the pyErrorMessage and then you can send the mail with that error message.
Point to note, all the broken process will be sent liek this, for the same queue item, you can get mail multiple times. To avaoid this, there are various ways and one such way is you can have a mail counter / mail flag on that queue item. Other effective way, is you can use the timestamp to overcome such limitation.
It is an exception handling scenario in the Standard Agent implementation. Ideally, the email notification should happen as part of the standard execution. Maintain the failure counter flag in the standard agent primary page. Then when it reaches 3, send an email notification to the appropriate stakeholders.
Another monitoring advanced agent comes with the maintenance and expensive from the performance point of view.
Please do let me know if you need further details on the approach.
"exception handling scenario in the Standard Agent implementation" , Do you mean everytime the Agent fails upon triggering from the activity ,we have to increment the failure counter and when the count reaches 3, include a transition step to trigger the email notification?
I think you requirement is to send an email when an item is moved to broken process and count does not matter. The simple solution I think create a report on System-Queue-DefaultEntry table including the status filter as Broken and pyAttempts as 3 ( this can also be a dss value if you want to make it dynamic) and use the schedule report feature in report definition to send an email with the list of all cases which went to broken queue.
And regarding the error , you can always open the broken-queue item to look the error.