Hi
I am trying to access my SB queue named ifslabscustomer_ifsapplicationsqueue using a WorkerRole in the cloud but getting the following exception:
A first chance exception of type 'System.ServiceModel.FaultException`1' occurred in Microsoft.ServiceBus.dll
A first chance exception of type 'System.TimeoutException' occurred in Microsoft.ServiceBus.dll
I have a standard implementation as follows:
public override bool OnStart()
{
// Set the maximum number of concurrent connections
ServicePointManager.DefaultConnectionLimit = 12;
// Create the queue if it does not exist already
string connectionString = CloudConfigurationManager.GetSetting("ServiceBusQueueConnectionString");
string queueName = CloudConfigurationManager.GetSetting("ServiceBusQueueName");
var namespaceManager = NamespaceManager.CreateFromConnectionString(connectionString);
if (!namespaceManager.QueueExists(queueName))
{
namespaceManager.CreateQueue(queueName);
}
// Initialize the connection to Service Bus Queue
Client = QueueClient.CreateFromConnectionString(connectionString, queueName);
return base.OnStart();
}
public override void Run()
{
Client.OnMessage((receivedMessage) =>
{
Trace.WriteLine("Received message");
}
CompletedEvent.WaitOne();
}