다음을 통해 공유


ServiceBusAdministrationClient.CreateQueueAsync Method

Definition

Overloads

CreateQueueAsync(CreateQueueOptions, CancellationToken)

Creates a new queue in the service namespace with the given name.

CreateQueueAsync(String, CancellationToken)

Creates a new queue in the service namespace with the given name.

CreateQueueAsync(CreateQueueOptions, CancellationToken)

Source:
ServiceBusAdministrationClient.cs
Source:
ServiceBusAdministrationClient.cs

Creates a new queue in the service namespace with the given name.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Messaging.ServiceBus.Administration.QueueProperties>> CreateQueueAsync (Azure.Messaging.ServiceBus.Administration.CreateQueueOptions options, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateQueueAsync : Azure.Messaging.ServiceBus.Administration.CreateQueueOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Messaging.ServiceBus.Administration.QueueProperties>>
override this.CreateQueueAsync : Azure.Messaging.ServiceBus.Administration.CreateQueueOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Messaging.ServiceBus.Administration.QueueProperties>>
Public Overridable Function CreateQueueAsync (options As CreateQueueOptions, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of QueueProperties))

Parameters

options
CreateQueueOptions

A CreateQueueOptions object describing the attributes with which the new queue will be created.

cancellationToken
CancellationToken

An optional CancellationToken instance to signal the request to cancel the operation.

Returns

The QueueProperties of the newly created queue.

Exceptions

An entity with the same name exists under the same service namespace.

The operation times out. The timeout period is initialized through the ServiceBusAdministrationClientOptions class (see Retry property). You may need to increase the value of timeout to avoid this exception if the timeout value is relatively low.

Either the specified size in the description is not supported or the maximum allowable quota has been reached. You must specify one of the supported size values, delete existing entities, or increase your quota size.

The server is busy. You should wait before you retry the operation.

The options instance is null.

Insufficient permission to perform this operation. You should check to ensure that your ServiceBusAdministrationClient has the necessary claims to perform this operation. https://learn.microsoft.com/azure/service-bus-messaging/service-bus-sas#rights-required-for-service-bus-operations

  • A queue with the same name exists under the same service namespace. The Reason will be set to MessagingEntityAlreadyExists in this case.
  • The operation timed out. The Reason will be set to ServiceTimeout in this case.
  • Either the specified size of the entity is not supported or the maximum allowable quota has been reached. You must specify one of the supported size values, delete existing entities, or increase your quota size. The failure reason will be set to QuotaExceeded in this case.
  • The server is busy. You should wait before you retry the operation. The failure reason will be set to ServiceBusy in this case.
  • An internal error or unexpected exception occurs. The failure reason will be set to GeneralError in this case.

Remarks

Throws if a queue already exists.

Applies to

CreateQueueAsync(String, CancellationToken)

Source:
ServiceBusAdministrationClient.cs
Source:
ServiceBusAdministrationClient.cs

Creates a new queue in the service namespace with the given name.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Messaging.ServiceBus.Administration.QueueProperties>> CreateQueueAsync (string name, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateQueueAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Messaging.ServiceBus.Administration.QueueProperties>>
override this.CreateQueueAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Messaging.ServiceBus.Administration.QueueProperties>>
Public Overridable Function CreateQueueAsync (name As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of QueueProperties))

Parameters

name
String

The name of the queue relative to the service namespace base address.

cancellationToken
CancellationToken

An optional CancellationToken instance to signal the request to cancel the operation.

Returns

The QueueProperties of the newly created queue.

Exceptions

An entity with the same name exists under the same service namespace.

The operation times out. The timeout period is initialized through the ServiceBusAdministrationClientOptions class (see Retry property). You may need to increase the value of timeout to avoid this exception if the timeout value is relatively low.

Either the specified size in the description is not supported or the maximum allowable quota has been reached. You must specify one of the supported size values, delete existing entities, or increase your quota size.

The server is busy. You should wait before you retry the operation.

The queue name is null or empty.

The queue name exceeds the maximum allowed length.

The queue name is otherwise invalid.

Insufficient permission to perform this operation. You should check to ensure that your ServiceBusAdministrationClient has the necessary claims to perform this operation. https://learn.microsoft.com/azure/service-bus-messaging/service-bus-sas#rights-required-for-service-bus-operations

  • A queue with the same name exists under the same service namespace. The Reason will be set to MessagingEntityAlreadyExists in this case.
  • The operation timed out. The Reason will be set to ServiceTimeout in this case.
  • Either the specified size of the entity is not supported or the maximum allowable quota has been reached. You must specify one of the supported size values, delete existing entities, or increase your quota size. The failure reason will be set to QuotaExceeded in this case.
  • The server is busy. You should wait before you retry the operation. The failure reason will be set to ServiceBusy in this case.
  • An internal error or unexpected exception occurs. The failure reason will be set to GeneralError in this case.

Remarks

Throws if a queue already exists. QueueProperties for default values of queue properties.

Applies to