Hi
Unable to send message to Topic, resulting in Channel Open did not complete within the specified timeout of 00:01:00 exception
static
voidMain(string[] args)
{
stringbaseTopic ="azuredemotopic";
stringconnectionString =ConfigurationManager.AppSettings["Microsoft.ServiceBus.ConnectionString"];
stringtopicConnectionString =ConfigurationManager.AppSettings["Microsoft.ServiceBus.Topic.ConnectionString"];
NamespaceManagerazManager =NamespaceManager.CreateFromConnectionString(connectionString);
azManager.Settings.OperationTimeout =
newTimeSpan(0, 10, 0);
ServiceBusEnvironment.SystemConnectivity.Mode = ConnectivityMode.AutoDetect;
if(!azManager.TopicExists(baseTopic))
{
azManager.CreateTopic(baseTopic);
}
if(!azManager.SubscriptionExists(baseTopic,"HighLoanAmount"))
{
SqlFilterhighLoanFilter =newSqlFilter("LoanAmount> 1000");
azManager.CreateSubscription(baseTopic,
"HighLoanAmount");
}
if(!azManager.SubscriptionExists(baseTopic,"LowLoanAmount"))
{
SqlFilterlowLoanFilter =newSqlFilter("LoanAmount< 1000");
azManager.CreateSubscription(baseTopic,
"LowLoanAmount");
}
MessagingFactorymsgFactory =MessagingFactory.Create(
azManager.Address,azManager.Settings.TokenProvider);
TopicClientclient = msgFactory.CreateTopicClient(baseTopic);
foreach(CustomercustomerinCreateCustomer())
{
Console.WriteLine("Press enter to Submit the message.....");
Console.ReadLine();
BrokeredMessagemessage =newBrokeredMessage(customer,newDataContractSerializer(typeof(Customer)));
message.Properties.Add(
"LoanAmount",customer.LoanAmount);
message.MessageId =
string.Format("LoanRequest_{0}",DateTime.Now.ToString());
message.ContentType =
"text/xml";
client.Send(message);
}
}
Subscription where created successfully, but when I client.Send(message); is invoked results in exception.
Any help will be appreciate!