I have the following Azure architecture:
IoTDevices ---> IoTHub ---> Function App
where:
- IoTDevices: collect sensor data and send them to IoTHub
- IoTHub: receives the data from devices and delivers those data to Function App (using Event Hub-compatible endpoint)
- Function App: performs some processing on the received data
now in the Function App I have something like this:
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
}
for several reasons, there are cases in which the processing can not be performed; I'd like to save the message SequenceNumber
and defer the message so that later, when the processing become available again, I can re-receive the message from the IoTHub.
So summarizing, the questions are:
- how can I defer my message?
- how can I re-receive/re-read the message given the
SequenceNumber
?