Quantcast
Channel: Service Bus forum
Viewing all articles
Browse latest Browse all 1916

Channel Open did not complete within the specified timeout of 00:01:00 - Sending message to Topic

$
0
0

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!


Viewing all articles
Browse latest Browse all 1916

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>