在 Azure Function Service Bus Queue Triggered 函数中接收消息的底层机制是什么?

What is the underlying mechanism to receive message in Azure Function Service Bus Queue Triggered functions?

我了解 Azure Function - Azure 存储队列触发函数是在轮询的基础上触发的。

但似乎无法找到它如何用于 Azure 服务总线队列。它是否也遵循轮询方法或与 Azure 服务总线队列客户端有一个会话,只要消息被发送到队列中就会被触发(类似于事件驱动的方法)?

请参考以下代码:

[FunctionName("ServiceBusFunction")]
public static void Run([ServiceBusTrigger("testQueueDuplicateDetection")] string myQueueItem, ILogger log)
{
    log.LogInformation($"C# ServiceBus queue trigger function processed message: {myQueueItem}");
}

SerivceBusTrigger 也基于轮询,因为底层服务架构:

Azure 服务总线特性:

is a reliable asynchronous message delivery (enterprise messaging as a service) that requires polling

Source.

不过,Azure Service Bus integrates with Azure Event Grid (Service Bus will send events to Azure EventGrid when there are new messages) so this would prevent you from polling - if you switch to Azure Event Grid Trigger反而。