Custom Visibility Timeout for Queue Nessage in Output Binding Context

RajeshR-0720 21 Reputation points
2021-08-17T11:46:08.67+00:00

When setting up a queue in output binding for a function , we have the ability to set a default visibility timeout as part of the host.json "queues": { "visibilityTimeout" : "00:00:30" } . However for each message if we need a custom visibility timeout it can only be achieved by the function queue_client.send_message(message,visibility_timeout=visibility_timeout_seconds) . This unnecessarily bloats the function app size as this step requires azure.storage.queue package ( python ) . But I guess it's the same across langauges . If one can be allowed to initialize the queue message object even when it is in output binding and set visibility timeout property to the step queueoutput.set(message,visibility_timeout=visibility_timeout_seconds ) , it can work wonders in uses cases that require a custom visibility timeout for each message without bloating the function app size.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,029 questions
0 comments No comments
{count} votes

Accepted answer
  1. Mike Urnun 9,811 Reputation points Microsoft Employee
    2021-08-18T22:05:12.02+00:00

    Hello @RajeshR-0720 - Welcome to Q&A and thank you for posting here!

    My two cents on the matter is that the configs that go into host.json are global by design (irrespective of binding type) and used during the instantiation of the runtime, whereas something like defining distinct values for visibilityTimeout property for each message is a more granular detail in scope & specific to an abstraction where the messages flow through the runtime itself. I'd assume that's mainly why this configuration was put together the way it is today and how its functionalities work presently.

    Since your post is suggestive of expanding an existing feature rather than a how-to or a troubleshooting question, I invite you to engage the Functions team directly on Functions host repo. Normally, we would recommend submitting a new feature on Azure UserVoice platform but it is currently under review for an improved experience.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.