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