jeudi 29 avril 2021

Azure Function - What Aggregation Pattern to Use?

We have the following scenario:

  1. Json Messages queued on Service Bus (they'll not all come together, will be during a specific period e.g. b/w midnight and 1 AM)

  2. We need a Function that reads the message, transforms it to a flat format and then appends that to a file

  3. File will eventually need to be sent to a Target System once the exit condition hits.

Now for this function that reads from Service Bus, I can think of 3 options.

  1. An ordinary stateless function, reads the data, creates a file as AppendBlob in Storage (if it doesn't exist) and writes (appends) data to it

  2. A singleton Function that gets triggered on first message being received on Service Bus and then receives all the subsequent messages until a time based exit condition hits, creates the file in Append Blob and keeps on appending data to it.

  3. Durable Function Aggregator pattern, I just had a quick read through it but not sure if that can be used in my scenario?

Looking for suggestions on how best to implement this scenario using Azure Functions that is reliable and doesn't run into concurrency issues, b/w we are on the latest version of Functions, so should be able to use all the latest features.

Aucun commentaire:

Enregistrer un commentaire