本文介绍了如何访问Azure订阅上的死信子队列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我使用以下内容时:
var deadLetterPath = SubscriptionClient.FormatDeadLetterPath(topicPath,subName);
var client = SubscriptionClient.CreateFromConnectionString(connectionString, deadLetterPath, subName);
我收到一个InvalidOperationException
I get an InvalidOperationException
Azure文档的某些部分说使用SubscriptionClient.CreateReceiver访问子队列,但是该方法不存在.
Some parts of the azure documentation say to use SubscriptionClient.CreateReceiver to access a sub-queue but that method doesn't exist.
推荐答案
这种方法对您有用吗?
MessagingFactory factory = MessagingFactory.CreateFromConnectionString(cnxString);
var deadLetterPath = SubscriptionClient.FormatDeadLetterPath(topicPath,subName);
var dlqReceiver = factory.CreateMessageReceiver(deadLetterPath, ReceiveMode.ReceiveAndDelete);
我还没有在这里(一次会议中)测试过,但是请尝试一下
I haven't test it out here (in a meeting), but give it a try
欢呼
这篇关于如何访问Azure订阅上的死信子队列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!