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));
}
}