Open thomaslevesque opened 4 years ago
Hi @thomaslevesque , Have you tried adding the property in your main function code like below:
var options = new SessionHandlerOptions { AutoComplete = false, MessageWaitTimeout = TimeSpan.FromSeconds(3) };
Usually the property is added in host.json like below:
"SessionHandlerOptions": { "autoComplete": false }
But if my understanding is correct, you are looking for a solution for individual function. Please try adding it in your main function.cs and let us know if it works for you.
But if my understanding is correct, you are looking for a solution for individual function
I am.
Please try adding it in your main function.cs and let us know if it works for you.
I don't understand what you mean... I'm not using sessions.
Where exactly are you including AutoComplete in your code?
Usually added in Host.json, where AutoComplete uses anther setting. Are you talking about any other functionality, could you paste a link for reference.
{ "version": "2.0", "extensions": { "serviceBus": { "SessionHandlerOptions": { "autoComplete": false } } } } }
On MessageHandlerOptions, not SessionHandlerOptions. But as mentioned in my original post, I don't want to disable AutoComplete globally.
Hi @thomaslevesque , In Host settings , we have the option of setting the Autocomplete only globally for now.
Tagging @alrod, for more inputs here. Is it possible to set the AutoComplete for a single function? Can we add this as a feature request?
I think the ask here is the same as in https://github.com/Azure/azure-functions-servicebus-extension/issues/138? I.e., to make the existing host level MessageHandlerOptions configurable per function as well?
@mathewc yes, exactly
Hi @thomaslevesque, Let us know if the above information resolves your query, or if you have any further queries.
@v-bbalaiagar no, it doesn't.
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days
I did send feedback...
Hi @v-bbalaiagar, @alrod, @v-anvari
Quick question on the way to set this autocomplete: false
for just one specific azure function and not affect all azure functions running on the function app ?
Reason for asking is, what's specified here : https://github.com/Azure/azure-functions-servicebus-extension/issues/138 doesn't seem to work. Can you please share details on how this can be addressed ?
Tagging @mathewc , for more inputs
Is your question related to a specific version? If so, please specify:
Microsoft.NET.Sdk.Functions 3.0.7 Microsoft.Azure.WebJobs.Extensions.ServiceBus 4.1.1
What language does your question apply to? (e.g. C#, JavaScript, Java, All)
C#
Question
Is it possible to have
AutoComplete
enabled, but still take manual control over it in some functions?In general, I'm fine with having
AutoComplete
to true, but I have some long-running functions that can run for longer than the lock duration, so I want to take explicit control of the message. Currently, I defer the message before I begin the actual work, and when I'm done, I retrieve the deferred message and complete it. This works, but I get an error after the message at the end of my function:I think this is because the function host tries to complete the message, which has already been completed.
Is it possible to disable AutoComplete for a specific function?