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

SubscriptionClient.AcceptMessageSession Failed with Timeout exception

$
0
0

I created a Azure Topic and a subscription with Session-Enabled to be true.  I can send a message to the topic with a non empty SessionId.  But When I tied to read the message with the following code, it throws the timeout execption at subClient.AcceptMessageSession. Did I do anything wrong?  The similar code (with QueueClient) works fine for a direct session enabled Azure Queue.

                    SubscriptionDescription subscriptionDescription = namespaceManager.GetSubscription(Topic_Name, Subscription_Name);
                    SubscriptionClient subClient = SubscriptionClient.CreateFromConnectionString(connectionString, Topic_Name, Subscription_Name);

                    if (subscriptionDescription.RequiresSession)
                    {
                        MessageSession msgSession = subClient.AcceptMessageSession(TimeSpan.FromSeconds(120));
                        if (msgSession != null)
                        {
                            message = msgSession.Receive(TimeSpan.FromSeconds(5));
                        }
                    }



Viewing all articles
Browse latest Browse all 1916

Trending Articles



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