Stop generating Broken queues / Queue processor

Hi,

is there any way to stop generating broken queues when max attempt is reached

#QueueProcessor

Hi @BachirAmazighB,

In Pega, when a queue processor reaches the maximum number of attempts for processing a queue item, it typically marks the item as “broken” and moves it to a broken-queue state. To manage this behavior and potentially stop generating broken queues, you need to configure error handling and the retry mechanism appropriately.

Configuring Error Handling and Retries for Queue Processors

To manage how queue processors handle retries and avoid generating broken queues, you can configure the retry logic and error handling settings. Here’s how you can approach this:

  1. Define Max Attempts:

    • Ensure the Max attempts property of the queue processor is set to an appropriate value that suits your requirement.
  2. Custom Error Handling:

    • Implement custom error handling in your queue processor activity or service that processes the queue item.
  3. Auto-Resolve Broken Items:

    • You can create an agent or a job scheduler to periodically review broken queue items and attempt to resolve them or move them to another state.

@KotiR16754433

for the custom error handling. do you have an example or what’s the native activity that pega execute to generate the brokens

thnx

@BachirAmazighB

In Queue Processor activity context Param.pzExecutionMetadata has the details of max attempts and retrial attempts.

1.Write a function to capture the value of pzAttempts Code snippet for reference

PublicAPI api = ThreadContainer.get().getPublicAPI();
ParameterPage page= api.getParameterPage();
ClipboardPage clipboardpg = page.getPage(“pzExecutionMetadata”);
page.put(“RetrialCount”,clipboardpg.getInteger(“pzAttempts”));

2.When RetrialCount > 2 try to skip the step which is making Activity-Set-Status to fail message

In this way we can avoid case going into BrokenQ

even after skipping the activity-set-status, still item is going to broken queue..