0
votes

We are working with Azure functions, which are using service bus queue triggers. We are trying to solve a problem whereby we need to disable a function on the function app processing messages, dynamically, so that it does not process messages any further and we do not lose any message in the process as well.

We tried the scenario of disabling the function app and simultaneously pushing the messages to the queue. When the function app is disabled and re-enabled, the previous enqueued messages get processed successfully. However, when the subsequent messages which are enqueued, the old messages which were processed when the app was disabled are also processed again.

It would be great someone could direct me to some documentation to understand the behavior exhibited in this scenario. Thanks.

1

1 Answers

0
votes

Not sure about your exact scenario but

  1. If you are looking for something like single message processing at a time then configuring your function as SINGLETON (attribute) will solve your problem.
  2. Your problem of coming older messages from queue may be because of - During function disable, your message is crossing lock duration period and in that case service bus will again push it into the queue.
  3. If you are implicitly (by locking or something) disabling certain execution portion of your function, function app will still read messages from queue. That's the default behavior.

Feel free for any further confusion/question.