My NServiceBus project would no longer read from Azure Queues.
I deleted them figuring there might be some messages stuck, but now it will no longer create the queues. Note: The same exact code and credentials used to create the queue automatically on its own. Instead I was getting:
40400: Endpoint not found..
at Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageSender.EndSendCommand(IAsyncResult result) at Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageSender.OnEndSend(IAsyncResult result) at Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageSender.OnSend(TrackingContext trackingContext, IEnumerable
1 messages, TimeSpan timeout) at Microsoft.ServiceBus.Messaging.MessageSender.Send(TrackingContext trackingContext, IEnumerable
1 messages, TimeSpan timeout) at Microsoft.ServiceBus.Messaging.MessageSender.Send(BrokeredMessage message) at Microsoft.ServiceBus.Messaging.QueueClient.Send(BrokeredMessage message) at NServiceBus.Unicast.Queuing.Azure.ServiceBus.AzureServiceBusMessageQueue.Send(Byte[] rawMessage, QueueClient sender) in c:\TeamCity\buildAgent\work\nsb.master_7\src\azure\Queueing\NServiceBus.Unicast.Queuing.AppFabric\AzureServiceBusMessageQueue.cs:line 179 at NServiceBus.Unicast.Queuing.Azure.ServiceBus.AzureServiceBusMessageQueue.Send(TransportMessage message, Address address) in c:\TeamCity\buildAgent\work\nsb.master_7\src\azure\Queueing\NServiceBus.Unicast.Queuing.AppFabric\AzureServiceBusMessageQueue.cs:line 160 at NServiceBus.Unicast.UnicastBus.SendSubscribeMessageWithRetries(Address destination, TransportMessage subscriptionMessage, String messageType, Int32 retriesCount) in c:\TeamCity\buildAgent\work\nsb.master_7\src\unicast\NServiceBus.Unicast\UnicastBus.cs:line 476 at NServiceBus.Unicast.UnicastBus.<>c_DisplayClass8.b_7(Object state) in c:\TeamCity\buildAgent\work\nsb.master_7\src\unicast\NServiceBus.Unicast\UnicastBus.cs:line 433 at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() at System.Threading.ThreadPoolWorkQueue.Dispatch()
My configuration is as follow:
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"
};
}
}
}