Azure / Azure/Azure-Functions

[Azure Function Binding] With AsyncCollector, if one message fails to process, would the trigger that started the original request signal an error, or would that error be lost?

Open
#1,683 0 comments 0 reactions 0 assignees View on GitHub
area: documentation
Dominant language
PowerShell
Stars
1.1k
Forks
215
Avg merge
4h 2m
Merged PRs (30d)
1

Description

Hi there,

We are using azure functions to read from a service bus queue and then output to a record in CosmosDB. Since we are not using a dedicated cosmosdb client in code and instead are calling ICollector's AddAsync(processedRecord) on the output binding, if one of those events collected fails to write, what happens to it and the rest? I am not seeing any official documentation on this Would the the error return after the function execution is out of scope, or are we guaranteed that the function that operated on the trigger throw an exception that we can catch. I read we can use try catches and such, but which we do, but we are specifically wondering what happens with AsyncCollector when there is more than 1 message being Added.

In other words, if the function pulls (prefetches)10 messages off service bus, calls ICollectors.AddAsync(processedRecord) for each trigger, and 1/10 produced an error writing to cosmosdb, will that original trigger error and the other 9 that were successful be written?

I see documentation on that we can call FlushAsync, and it reads like we'd have to call FlushAsync each time to confirm there is no error. Is this correct?

Thanks in advance for the info!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.