System.Net.Sockets.SocketException (10060), timeout due to closed ports
Please be aware that it is not possible in some environments to open the firewall for the ports that AMQP over TCP need (5671, 5672). The closed ports will lead to a timeout and the given error message in the title.
So I would suggest that you add ServiceBusClientOptions to use with the ServiceBusClient and set the TransportType for the options to AmqpWebSockets which will use port 443:
So in both source codes the line
// Create the client object that will be used to create sender and receiver objects
client = new ServiceBusClient(connectionString);
will change to the following:
var options = new ServiceBusClientOptions(); // or make that a static like client
options.TransportType = ServiceBusTransportType.AmqpWebSockets;
// Create the client object that will be used to create sender and receiver objects
client = new ServiceBusClient(connectionString, options);
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 217f29ba-3552-f406-58d3-d2e0c3bd4d2c
- Version Independent ID: 003342a6-6fc5-fae4-31f4-369b561cfd89
- Content: Get started with Azure Service Bus queues (.NET) - Azure Service Bus
- Content Source: articles/service-bus-messaging/service-bus-dotnet-get-started-with-queues.md
- Service: service-bus-messaging
- GitHub Login: @spelluru
- Microsoft Alias: spelluru
@OcasoProtal Thanks for your feedback. We will review and update as appropriate.
@spelluru Can you please review and provide your insights.
@OcasoProtal - Thanks for the feedback. I have updated the article, which will go live in an hour.
#please-close