Scheduled Agents with Auto queue management
I have a scheduled Agent 'ProcessReportQueues', 5 entries of this that call activities ProcessQ1, ProcessQ2, ..Q5 from the class System-Queue-DefaultEntry.
All have Interval '30sec', are of mode 'Standard', Category is 'Uncategorized' and 'Auto-queue management' checked.
1. Are items within a queue processed first-come-first-serve?
2. Does each task have to complete before the next one is picked within the same queue?
3. The PegaRules-Batch-<number> that we see in the log, does this Batch# correspond to particular queue everytime?
For example, does Batch3 always refers to a particular queue, say 'ProcessQ2'
Or can Batch3 can sometimes be for a task in ProcessQ1 and sometimes for ProcessQ2?
4. I have a Declare Trigger on 'CommittedSave' that calls an activity which pushes the item to the queue for the agent 'ProcessReportQueues' agent.
When a work object say 'WO-ABC' is CommittedSave twice within few seconds, it's pushed into 2 queues, say ProcessQ3 and ProcessQ4.
However, ProcessQ3 and Q4 may finish the task in order different than the original call was made and is giving incorrect results.
For example, if WO-ABC has a property set to 'pOld' and CommittedSave, and then property set to 'pNew' and CommittedSave, both occuring within few seconds
I have a scheduled Agent 'ProcessReportQueues', 5 entries of this that call activities ProcessQ1, ProcessQ2, ..Q5 from the class System-Queue-DefaultEntry.
All have Interval '30sec', are of mode 'Standard', Category is 'Uncategorized' and 'Auto-queue management' checked.
1. Are items within a queue processed first-come-first-serve?
2. Does each task have to complete before the next one is picked within the same queue?
3. The PegaRules-Batch-<number> that we see in the log, does this Batch# correspond to particular queue everytime?
For example, does Batch3 always refers to a particular queue, say 'ProcessQ2'
Or can Batch3 can sometimes be for a task in ProcessQ1 and sometimes for ProcessQ2?
4. I have a Declare Trigger on 'CommittedSave' that calls an activity which pushes the item to the queue for the agent 'ProcessReportQueues' agent.
When a work object say 'WO-ABC' is CommittedSave twice within few seconds, it's pushed into 2 queues, say ProcessQ3 and ProcessQ4.
However, ProcessQ3 and Q4 may finish the task in order different than the original call was made and is giving incorrect results.
For example, if WO-ABC has a property set to 'pOld' and CommittedSave, and then property set to 'pNew' and CommittedSave, both occuring within few seconds
Now, queue ProcessQ3 would have picked pOld and wrote to a target database and ProcessQ4 would have picked pNew and wrote to the same target database.
But since ProcessQ3 and Q4 are independent we have cases where Q3 finished the task later than Q4 and hence pNew was written to the target database first and quickly overwritten with pOld.
This is making our target data incorrect.
How to resolve this issue?
How can we force item with same WO name to be pushed to the same queue if it already exists in a queue?
For example when queued to Agent 'ProcessReportQueues', can it check if the WO already exists (because of previous queuing) in any of the ProcessQ2...Q5 and if does, then push it to the same queue?
Thanks
I assume you are using the multiple agents to process at a higher rate. It seems your requirement maybe could be met by checking a certain update/save time stamp to ensure the current update to the database isn't older than the other update with your agent. You could also split out the agents to not pull from the same queue and ensure each id is routed to certain queue based on same processing like id number modulo 5 goes to queue number modulo 5. I suspect even the later strategy you could encounter conditions where record based a lock conflict is processed out of order.