I’m trying to wait asynchronous API which does not have notification mechanism like webhook with Azure Function’s queue trigger.
Here is TypeScript pesudo code:
const queueTrigger: AzureFunction = async function (c: Context, idForExternalApi:string): Promise<void> {
const status = getStatusFromExternalAsyncApi(idForExternalApi);
if (status === "DONE") {
// handle api result
// message is automatically dequeued if no error occurs.
} else if (status == "PROCESSING") {
// How can I push back queue message here with some visibility timeout?
}
};
How can I reenqueue message if API is still processing?
Of course I can enqueue a new message identical to current one, but that feels mess up queue and lose information like dequeue count, how long event took etc.
I also do not want to raise error for this purpose since such error should be for implementation bug.
Any idea?