【问题标题】:Reading Messages From Topic on storage blob through subscriber on Service Bus Explorer - C#通过服务总线资源管理器上的订阅者从存储 blob 上的主题读取消息 - C#
【发布时间】:2016-12-30 07:59:59
【问题描述】:

工作场景:

  1. 将 Msg1 发布到主题
  2. 将 Msg2 发布到主题
  3. 读取 Msg1、Msg2

不工作:

  1. 将 Msg1 发布到主题
  2. 通过订阅者从主题读取 Msg1,但我没有标记为完成。(仍在队列中)
  3. 将 Msg2 发布到主题
  4. 阅读 Msgs.. 实际:我只阅读 Msg2 期望:想阅读 Msg1、Msg2。

       if (namespaceManager.TopicExists(topic))
                    {
                        var lstOfValues = new List<SITConfirmation>();
                        SubscriptionClient Client = SubscriptionClient.CreateFromConnectionString(ConfigurationManager.ConectionString(), topic, subscriber);
                        IEnumerable<BrokeredMessage> messages = await Client.ReceiveBatchAsync(10, TimeSpan.FromMilliseconds(500));
                     }
    

【问题讨论】:

  • 订阅时设置的 MaxDelliveryCount 是什么?存储 Blob 与此有何关系?
  • MaxDelliveryCount 为 10

标签: azure azure-blob-storage servicebus azure-servicebus-topics


【解决方案1】:

ReceiveBatchAsync(messageCount) 不会保证您获得请求的确切消息数量。网关可以有或没有所有的消息。它将返回它拥有的任何东西(网关可能有更少/更多/相同数量的实际存储在代理实体上的消息)。

来自documentation

由于这是一个近似值,因此返回的消息可能少于或多于 messageCount。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-02-12
    • 1970-01-01
    • 1970-01-01
    • 2018-07-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多