I was creating the queues with 50 events. Each events has jira cloud rest API call. As the jira cloud API throws 429 error for rate limit exceed I wanted to try the sequential queue mechanism i.e. the first queue creates the 50 events and after completion of all 50 events, I wanted to create a new queue and create another 50 events in that and so on.
And for that, i wanted to ask that is there a way that i can track whether all the events has successfully completed or not and whether the next queue is ready for a trigger or not.
No, I did not find any solution for this so I reduced my events and kept the retry mechanism and the delay every queue by some time. This somehow solved my problem.
Hi, I actually found a way around it.
I have a function that calls itself again at the end. Inside it, I create 50 events. This function is called by the consumer. The function stops calling itself recursively when it reaches the bottom of my list of events.
Something like this (the example is for an action):
async function create() {
// prep my payload
await callQueue(myPayload);
}
async function callQueue(payload) {
const queue = new Queue({ key: "queue-name" });
await queue.push(payload);
}
}
async function doStuff(payload) {
// do things
if (iReachedTheEndOfMyEvents) {
// wrap up
} else {
// create new payload
await callQueue(newPayload);
}
}