Share via


ServiceBusNamespaceClient.CreateQueue Method (String)

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

Namespace:  Microsoft.ServiceBus
Assembly:  Microsoft.ServiceBus.Messaging (in Microsoft.ServiceBus.Messaging.dll)

Syntax

'Declaration
Public Function CreateQueue ( _
    path As String _
) As Queue
'Usage
Dim instance As ServiceBusNamespaceClient
Dim path As String
Dim returnValue As Queue

returnValue = instance.CreateQueue(path)
public Queue CreateQueue(
    string path
)
public:
Queue^ CreateQueue(
    String^ path
)
member CreateQueue : 
        path:string -> Queue 
public function CreateQueue(
    path : String
) : Queue

Parameters

  • path
    Type: System.String
    Path of the queue relative to the service namespace base address.

Return Value

Type: Microsoft.ServiceBus.Messaging.Queue
Returns a newly-created Queue object.

Exceptions

Exception Condition
ArgumentException

path is null or empty.

ArgumentOutOfRangeException

Length of path is greater than 290 characters.

TimeoutException

The operation times out. The timeout period is initialized through the ServiceBusNamespaceClientSettings class. You may need to increase the value of the OperationTimeout property to avoid this exception if the timeout value is relatively low.

MessagingEntityAlreadyExistsException

A queue or a topic with the same name and path exists under the same service namespace.

UnauthorizedAccessException

The ServiceBusNamespaceClient object does not have sufficient permission to perform this operation. You should check to ensure that your ServiceBusNamespaceClient has the correct Credential credentials to perform this operation.

QuotaExceededException

The maximum allowable quota has been reached. You must delete existing entities or increase your quota size.

MessagingException

An internal error or unexpected exception occurs.

ServerBusyException

The server is overloaded with logical operations. You can consider any of the following actions:

  • Wait and retry calling this function.

  • Remove entities before retry (for example, receive messages before sending any more).

See Also

Reference

ServiceBusNamespaceClient Class

CreateQueue Overload

Microsoft.ServiceBus Namespace