从Azure的主题接收邮件产生空,主题有未读邮件 [英] Receiving message from Azure Topic yields null, topic has unread messages

查看:132
本文介绍了从Azure的主题接收邮件产生空,主题有未读邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

昨天,我能够从我创建自己的Azure的服务总线主题的订阅反复读消息。然而,今天,而使用相同的code截至昨天,所有的消息都为空尽管订阅的邮件数远高于0。让我解释:

Yesterday I was able to repeatedly read messages from a subscription of an Azure Service Bus Topic that I created myself. Today, however, whilst using the same code as yesterday, all messages are null despite that the message count of the subscription is well above 0. Let me elaborate:

继MSDN网站有关如何指令
<一href=\"http://www.windowsazure.com/en-us/documentation/articles/service-bus-dotnet-how-to-use-topics-subscriptions/\"相对=nofollow>阅读订阅的消息,我用下面的读取订阅客户端的消息:

Following the instruction on the MSDN site concerning how to read messages from subscription , I'm using the following to read messages from a subscription client:

var tokenProvider = TokenProvider.CreateSharedSecretTokenProvider("MySubscriber","MyKey");
var serviceUri = ServiceBusEnvironment.CreateServiceUri("sb", "MyNamespace", string.Empty);
var messagingFactory = MessagingFactory.Create(serviceUri, tokenProvider);
var subscriptionClient = messagingFactory.CreateSubscriptionClient("MyTopicName", "MySubscriptionName", ReceiveMode.PeekLock);

var brokeredMessage = subscriptionClient.Receive();

今天,brokeredMessage变量总是空的,但你可以从下面的截图看到,有在申购几条消息。

Today, the brokeredMessage variable is always null, but as you can see from the following screenshot, there are several messages in the subscription.

那么,为什么brokeredMessage == NULL?

So why does brokeredMessage == null?

该主题的设置都在管理门户网站设置和有:默认消息的生存时间= 1个小时,出版没有设置前重复检测的历史= 10分钟,过滤消息,题目状态=启用,并且没有共享访问政策。

The settings of the topic have been set in the management portal and are: Default message time to live = 1 hour, duplicate detection history = 10 min, filter message before publishing not set, topic state = enabled, and no shared access policies.

同样,对于认购,该设置是:默认消息的生存时间= 10分钟,锁定时间为5秒,最大传递计数= 10,主题订阅状态=启用,并没有涉及移动邮件的复选框已检查。

Likewise for the subscription, the settings are: Default message time to live = 10 min, Lock duration = 5 sec, Maximum delivery count = 10, Topic subscription state = Enabled, and none of the checkboxes concerning moving messages have been checked.

我会为任何想法感谢。

推荐答案

我已经找到了解决问题的办法;简单地删除预订并重新添加它。然而,这是为什么我不能阅读的邮件。下面的<一个href=\"http://stackoverflow.com/questions/8665858/azure-servicebus-returns-null-on-client-receive?rq=1\">thread在计算器使我相信这消息是死的,字母的,尽管显示否则的屏幕截图。

I've found a solution to the problem; simply delete the subscription and re-add it. That is, however, why I couldn't read the messages. The following thread on stackoverflow leads me to believe that the messages were dead-lettered, despite the screenshot showing otherwise.

如果我找出原因的问题,我会更新这个答案。

If I figure out the reason for the problem, I will update this answer.

这篇关于从Azure的主题接收邮件产生空,主题有未读邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆