azure-logic-appsazureservicebusazure-logic-app-standard

How to consume multiple/all messages from a topic subscription?


I have an On-Premise Data Gateway that will send data to an on-prem SQL DB via Logic App, received from the Service Bus.

I've got a Logic App that is currently triggering on When a message is received in a topic subscription (auto-complete). It then passes the decoded contents of that message into an array, where it is JSON formatted and then sent to the on-prem SQL DB via an Execute stored procedure (V2) action.

Currently, it does this instance by instance - but I'd like to reduce transactional cost by batching all available messages into one array via a single Logic App instance.

What would be the best way of achieving this?


Solution

  • Currently, it does this instance by instance

    This is the behavior of this connector. For parallelly picking messages you can use When one or more messages arrive in a topic (peek-lock) and can add Maximum message count, but it will also invoke instance parallelly:

    According to Microsoft-Document, it says:

    The operation receives one or more messages from a topic with peek-lock. If maximum message count is not provided, it reads 20 messages.

    enter image description here