Azure Function App - 如何延迟和重新接收无法处理的消息

Azure Function App - How to defer and re-receive an unprocessable message

我有以下 Azure 架构:

IoTDevices ---> IoTHub ---> 功能应用程序

其中:

现在在功能应用程序中我有这样的东西:

public static void Run([IoTHubTrigger("messages/events", Connection = "EventHubConnection")]EventData message, TraceWriter log)
{
  string messageString = Encoding.UTF8.GetString(message.GetBytes());
  //do some processing with messageString as input
}

由于多种原因,存在无法进行处理的情况;我想保存消息 SequenceNumber 并延迟消息,以便稍后当处理再次可用时,我可以重新接收来自 IoTHub 的消息。 所以总结一下,问题是:

https://docs.microsoft.com/en-us/azure/service-bus-messaging/message-deferral

Deferred messages remain in the main queue along with all other active messages (unlike dead-letter messages that live in a subqueue), but they can no longer be received using the regular Receive/ReceiveAsync functions. Deferred messages can be discovered via message browsing if an application loses track of them.