NServiceBus无法在Azure中创建队列

时间:2013-12-29 02:03:08

标签: c# azure nservicebus azure-queues

我的NServiceBus项目将不再从Azure队列中读取。

我删除了他们,发现可能会有一些消息被卡住,但现在它将不再创建队列。注意:用于自动创建队列的完全相同的代码和凭据。相反,我得到了:

  

40400:找不到端点..

     

在   Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageSender.EndSendCommand(IAsyncResult的   结果)在   Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageSender.OnEndSend(IAsyncResult的   结果)在   Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageSender.OnSend(TrackingContext   trackingContext,IEnumerable 1 messages, TimeSpan timeout) at Microsoft.ServiceBus.Messaging.MessageSender.Send(TrackingContext trackingContext, IEnumerable 1条消息,TimeSpan超时)at   Microsoft.ServiceBus.Messaging.MessageSender.Send(BrokeredMessage   消息)   Microsoft.ServiceBus.Messaging.QueueClient.Send(BrokeredMessage   消息)   NServiceBus.Unicast.Queuing.Azure.ServiceBus.AzureServiceBusMessageQueue.Send(字节[]   rawMessage,QueueClient sender)in   C:\ TeamCity的\ buildAgent \工作\ nsb.master_7的\ src \天蓝\排队\ NServiceBus.Unicast.Queuing.AppFabric \ AzureServiceBusMessageQueue.cs:行   179点   NServiceBus.Unicast.Queuing.Azure.ServiceBus.AzureServiceBusMessageQueue.Send(TransportMessage   消息,地址)   C:\ TeamCity的\ buildAgent \工作\ nsb.master_7的\ src \天蓝\排队\ NServiceBus.Unicast.Queuing.AppFabric \ AzureServiceBusMessageQueue.cs:行   160点   NServiceBus.Unicast.UnicastBus.SendSubscribeMessageWithRetries(地址   destination,TransportMessage subscriptionMessage,String messageType,   Int32 retriesCount)in   C:\ TeamCity的\ buildAgent \工作\ nsb.master_7 \ SRC \单播\ NServiceBus.Unicast \ UnicastBus.cs:线   476在   NServiceBus.Unicast.UnicastBus<> C_ DisplayClass8.b _7(对象   国家)   C:\ TeamCity的\ buildAgent \工作\ nsb.master_7 \ SRC \单播\ NServiceBus.Unicast \ UnicastBus.cs:线   433在   System.Threading.ExecutionContext.RunInternal(执行上下文   executionContext,ContextCallback回调,对象状态,布尔值   preserveSyncCtx)at   System.Threading.ExecutionContext.Run(执行上下文   executionContext,ContextCallback回调,对象状态,布尔值   preserveSyncCtx)at   System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()   在System.Threading.ThreadPoolWorkQueue.Dispatch()

我的配置如下:

using NServiceBus.Config;
using NServiceBus.Config.ConfigurationSource;

namespace XXX
{
    public class AzureConfigurationProvider : 
        IProvideConfiguration<AzureServiceBusQueueConfig>,
        IProvideConfiguration<AzureSubscriptionStorageConfig>,
        IProvideConfiguration<AzureSagaPersisterConfig>,
        IProvideConfiguration<AzureDataBusConfig>
    {
        AzureServiceBusQueueConfig IProvideConfiguration<AzureServiceBusQueueConfig>.GetConfiguration()
        {
            return new AzureServiceBusQueueConfig
                       {
                           QueueName = "XXX",
                           IssuerKey = "XXX",
                           IssuerName = "XXX",
                           ServiceNamespace = "XXX"
                       };
        }

        AzureSubscriptionStorageConfig IProvideConfiguration<AzureSubscriptionStorageConfig>.GetConfiguration()
        {
            return new AzureSubscriptionStorageConfig
                       {
                           ConnectionString = "DefaultEndpointsProtocol=https;" +
                                                "AccountName=XXX;" +
                                                "AccountKey=XXX",
                           CreateSchema = true
                       };
        }

        AzureSagaPersisterConfig IProvideConfiguration<AzureSagaPersisterConfig>.GetConfiguration()
        {
            return new AzureSagaPersisterConfig
                       {
                           ConnectionString = "DefaultEndpointsProtocol=https;" +
                                              "AccountName=XXX;" +
                                              "AccountKey=XXX",
                           CreateSchema = true
                       };
        }

        AzureDataBusConfig IProvideConfiguration<AzureDataBusConfig>.GetConfiguration()
        {
            return new AzureDataBusConfig
            {
                ConnectionString = "DefaultEndpointsProtocol=https;" +
                                   "AccountName=XXX;" +
                                   "AccountKey=XXX"
            };
        }
    }
}

1 个答案:

答案 0 :(得分:1)

您使用的是哪种版本的NServiceBus?

此外,NSB不会创建目标队列,端点只会创建从启动时读取的队列。删除队列后,您是否重新启动了侦听该队列的端点?