使用 Azure.Messaging.ServiceBus 中的 id 完成消息

Complete messages using id in Azure.Messaging.ServiceBus

我们今天有一个使用 Microsoft.Azure.ServiceBus 包的应用程序,我们想迁移到使用 Azure.Messaging.ServiceBus 包。

应用程序接收来自主题订阅的消息,并使用 IReceiverClient.CompleteAsync(lockToken) 手动完成或放弃这些消息。

此行为是否在 Azure.Messaging.ServiceBus 包中可用,或者我们是否被迫使用 ServiceBusReceivedMessage 完成/放弃消息?

最新的 SDK 要求 ServiceBusReceivedMessage 用于完成或放弃收到的消息。有一个 design discussion with the Azure SDK team, whether to expose an overload that takes lock tokens or not. In the end, the Azure SDK team has decided 不公开那些重载。