Azure / azure-service-bus-dotnet

☁️ .NET Standard client library for Azure Service Bus
https://azure.microsoft.com/services/service-bus
Other
235 stars 120 forks source link

Facing Timeout with Microsoft.Azure.ServiceBus, working fine with WindowsAzure.ServiceBus package #635

Closed tushartyagi closed 5 years ago

tushartyagi commented 5 years ago

Actual Behavior

  1. Creating new application to use Microsoft.Azure.ServiceBus (3.3.0) causing timeout exception.
  2. Samples provide at azure-service-bus also getting timeout if I provide the connection string.
  3. Azure dashboard show incoming requests, but no messages.
  4. Changing the code to use WindowsAzure.ServiceBus (5.1.0) works
  5. ServiceBusExplorer works (because it also uses the WindowsAzure.ServiceBus package??)

Expected Behavior

  1. Samples should run if I provide the connection strings.
  2. I should not get timeout exception.

Versions

image

tushartyagi commented 5 years ago

In case the stack trace is required. Using TopicSubscriptionWithRuleOperationsSample

Microsoft.Azure.ServiceBus.ServiceBusCommunicationException
  HResult=0x80131500
  Message=A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond ErrorCode: TimedOut
  Source=Microsoft.Azure.ServiceBus
  StackTrace:
   at Microsoft.Azure.ServiceBus.Amqp.AmqpSubscriptionClient.<OnRemoveRuleAsync>d__27.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.ServiceBus.SubscriptionClient.<RemoveRuleAsync>d__51.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at TopicSubscriptionWithRuleOperationsSample.Program.<MainAsync>d__12.MoveNext() in D:\home\coding\dotnet\azure-service-bus\samples\DotNet\GettingStarted\Microsoft.Azure.ServiceBus\TopicSubscriptionWithRuleOperationsSample\Program.cs:line 44
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at TopicSubscriptionWithRuleOperationsSample.Program.Main(String[] args) in D:\home\coding\dotnet\azure-service-bus\samples\DotNet\GettingStarted\Microsoft.Azure.ServiceBus\TopicSubscriptionWithRuleOperationsSample\Program.cs:line 31

Inner Exception 1:
SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
SeanFeldman commented 5 years ago

ServiceBusExplorer works (because it also uses the WindowsAzure.ServiceBus package??)

Correct.

Is TCP port 5671 blocked by any chance? If yes, you'll have to switch using WebSockets. To validate, you could spin up a VM on Azure and run a sample. I suspect your environment is blocking the TCP port used for AMQP by default.

tushartyagi commented 5 years ago

Yes! That was the issue. My org had opened port 5672 for AMQP connections. Opening 5671 as well resolved the issue.

Thank you so much.

Closing this issue.