@@ -185,8 +185,11 @@ This section shows you how to create a .NET Core console application to send mes
185
185
// of the application, which is best practice when messages are being published or read
186
186
// regularly.
187
187
//
188
- // Create the clients that we'll use for sending and processing messages.
189
- client = new ServiceBusClient(connectionString);
188
+ // set the transport type to AmqpWebSockets so that the ServiceBusClient uses the port 443.
189
+ // If you use the default AmqpTcp, you will need to make sure that the ports 5671 and 5672 are open
190
+
191
+ var clientOptions = new ServiceBusClientOptions() { TransportType = ServiceBusTransportType.AmqpWebSockets };
192
+ client = new ServiceBusClient(connectionString, clientOptions);
190
193
sender = client.CreateSender(queueName);
191
194
192
195
// create a batch
@@ -332,10 +335,12 @@ In this section, you'll add code to retrieve messages from the queue.
332
335
// of the application, which is best practice when messages are being published or read
333
336
// regularly.
334
337
//
338
+ // set the transport type to AmqpWebSockets so that the ServiceBusClient uses the port 443.
339
+ // If you use the default AmqpTcp, you will need to make sure that the ports 5671 and 5672 are open
335
340
336
- // Create the client object that will be used to create sender and receiver objects
337
- client = new ServiceBusClient(connectionString);
338
-
341
+ var clientOptions = new ServiceBusClientOptions() { TransportType = ServiceBusTransportType.AmqpWebSockets };
342
+ client = new ServiceBusClient(connectionString, clientOptions );
343
+
339
344
// create a processor that we can use to process the messages
340
345
processor = client.CreateProcessor(queueName, new ServiceBusProcessorOptions());
341
346
@@ -414,9 +419,11 @@ In this section, you'll add code to retrieve messages from the queue.
414
419
// of the application, which is best practice when messages are being published or read
415
420
// regularly.
416
421
//
422
+ // set the transport type to AmqpWebSockets so that the ServiceBusClient uses the port 443.
423
+ // If you use the default AmqpTcp, you will need to make sure that the ports 5671 and 5672 are open
417
424
418
- // Create the client object that will be used to create sender and receiver objects
419
- client = new ServiceBusClient(connectionString);
425
+ var clientOptions = new ServiceBusClientOptions() { TransportType = ServiceBusTransportType.AmqpWebSockets };
426
+ client = new ServiceBusClient(connectionString, clientOptions );
420
427
421
428
// create a processor that we can use to process the messages
422
429
processor = client.CreateProcessor(queueName, new ServiceBusProcessorOptions());
0 commit comments