如何完全消耗主题订阅?

时间:2018-02-15 17:30:52

标签: azureservicebus

我在主题订阅中有大约1,400条消息。当我去批量接收时,例如使用Service Bus Explorer,例如500条消息。我几乎没有回来。这是SBE的控制台剪辑。

<12:09:45> The subscription billingpackage for the checkoutsubmitted topic has been successfully retrieved.
<12:09:46> [36] messages received from the subscription [billingpackage].
<12:10:28> The subscription billingpackage for the checkoutsubmitted topic has been successfully retrieved.
<12:10:28> [120] messages received from the subscription [billingpackage].
<12:11:59> The subscription billingpackage for the checkoutsubmitted topic has been successfully retrieved.
<12:11:59> [40] messages received from the subscription [billingpackage].
<12:13:14> The subscription billingpackage for the checkoutsubmitted topic has been successfully retrieved.
<12:13:15> [66] messages received from the subscription [billingpackage].
<12:14:12> The subscription billingpackage for the checkoutsubmitted topic has been successfully retrieved.
<12:14:12> [140] messages received from the subscription [billingpackage].

为什么我没有得到500我要求的?如果重要的话,我在标准级别。

1 个答案:

答案 0 :(得分:2)

这是预期的。您在批处理接收中指定的数字仅是批处理中要检索的最大消息数。收到的实际消息数可以是1到最大值之间的任何值。如果批量接收呼叫返回的次数小于指定的最大次数,则并不意味着队列中只有这么多消息。只有队列或订阅为空的指示才是接收调用返回null。在您的情况下,您应该继续批量接收,直到它返回null。