The Service Bus Queue which had been running without any error, occurs the following error.
--------------------------------------
An unhandled exception of type 'System.UnauthorizedAccessException' occurred in Microsoft.ServiceBus.dll
Additional information: The remote server returned an error: (401) does not allow claim is empty TrackingId:. F1ae8661-2b46-433e-9621-c7b91c5927e3_G7, SystemTracker: digipub.servicebus.windows.net: DigipubOrder_Session, Timestamp: 7/20/2016 2:18:55 AM
--------------------------------------
By debugging, I found that the error ocurrs at "namespaceManager.QueueExists (queueName)" in the following C# source. I checked again this "ConnectionString" by the Azure management portal. It was the same string.
- Is there an expiration date of ConnectionString?
- In that case, how can we update it?
- Or is there any possibility of adverse effect of the current Service Bus Queue version-up? In that case, please tell us how can we solute the problem.
- In such a case as "destructive" version-up giving a direct impact on the running program, where will the pre-announcement be done?
Any help and hint is most welcome.
Thank you in advance.
--------------------------------------
(C# source for PowerShell library)
public QueueClient InitializeParamWithSession(string connectionString, string queueName, bool useSession, bool? deleteAfterReceipt)
{
QueueDescription queueDescription = new QueueDescription(queueName)
{
RequiresSession = useSession
};
var namespaceManager = NamespaceManager.CreateFromConnectionString(connectionString);
if (!namespaceManager.QueueExists(queueName))
{
namespaceManager.CreateQueue(queueDescription);
}
var GQueueClient = CreateQueueClient(connectionString, queueName, deleteAfterReceipt);
return GQueueClient;
}
public QueueClient CreateQueueClient(string connectionString,string queueName, bool? deleteAfterReceipt)
{
ReceiveMode receiveMode;
if (deleteAfterReceipt != null)
{
if (deleteAfterReceipt == true)
{
receiveMode = ReceiveMode.ReceiveAndDelete;
}
else
{
receiveMode = ReceiveMode.PeekLock;
}
return MessagingFactory.CreateFromConnectionString(connectionString).CreateQueueClient(queueName, receiveMode);
}
else
{
return MessagingFactory.CreateFromConnectionString(connectionString).CreateQueueClient(queueName);
}
}
--------------------------------------