I’m having queue trouble. I implemented this about 10 hours ago and it went fine and it worked. I’ve changed stuff and it did not work anymore. I went back to the code situation that it worked, no such luck, it stopped working with that situation too. I can’t 100% exclude that I may have changed something else, but as far as I have been able to ascertain, I have not. Situation now:
A function pushes the payload on the queue:
const DL_assertComponentIsInGlobalDLDict = async (context, type, content) => {
console.log(`DL_assertComponentIsInGlobalDLDict`);
const payLoad = { "spaceKey": context.spaceKey, "contentId": context.contentId, "localId": context.localId, "type": type, "content": content};
console.log(`DL_assertComponentIsInGlobalDLDict: All info about my payLoad: ${JSON.stringify(payLoad, null, 2)}`);
await dlDictQueue.push( payLoad);
return 0;
}
The log shows what is being put on the queue:
INFO 2023-03-25T00:48:56.552Z 4b4b4ec3-d749-4b35-a591-a2c1cf6f89db DL_assertComponentIsInGlobalDLDict: All info about my payLoad: {
"spaceKey": "DLDEV",
"contentId": "3866625",
"localId": "804d94d7-3642-422b-a286-aa3ee5a56582",
"type": "DL_OutgoingRequirement",
"content": {
"requirement": "Operating Systems cannot use more that 64GB RAM."
}
}
The consumer code starts with:
dlDictResolver.define("dldict-event-listener", async ({ eventPayload, eventContext }) => {
console.log(`DLDict event queue listener`);
console.log(`DLDict event queue listener: All info about my context: ${JSON.stringify(eventContext, null, 2)}`);
console.log(`DLDict event queue listener: All info about my payload: ${JSON.stringify(eventPayload, null, 2)}`);
And the log shows that it is called, but payload and context are undefined
:
INFO 2023-03-25T00:48:57.751Z 135d6a9b-95ec-4847-b920-ee8e2d7a7b88 DLDict event queue listener
INFO 2023-03-25T00:48:57.752Z 135d6a9b-95ec-4847-b920-ee8e2d7a7b88 DLDict event queue listener: All info about my context: undefined
INFO 2023-03-25T00:48:57.752Z 135d6a9b-95ec-4847-b920-ee8e2d7a7b88 DLDict event queue listener: All info about my payload: undefined
Can a queue become corrupted and if so, what should I do?