How to process a message from the message queue
A message should remain in the queue while it is being processed and removed after all operations are completed. This ensures the message is not lost in case any of the processing operation fails to complete and the message can be re-process again in a later time.
The following actions are required to implement this design:
Use the
Service Bus => When a message is received in a queue (peek-lock)
trigger to monitor the message queue;Use the
Data Operations => Compose
action to convert the message from Base64 string to JSON; The input is:json(decodeBase64(triggerBody()?['ContentData']))
which uses two built-in functions to complete the data conversion.Implement the required operations using the message, e.g. use the message to invoking the API;
Use the
Service Bus => Complete the message in a queue
action to remove the message after all operations are completed;