ServiceBusNamespaceClient.CreateQueue Method (String, QueueDescription)
Creates a new queue in the service namespace with the given path and queue description.
Namespace: Microsoft.ServiceBus
Assembly: Microsoft.ServiceBus.Messaging (in Microsoft.ServiceBus.Messaging.dll)
Syntax
'Declaration
Public Function CreateQueue ( _
path As String, _
description As QueueDescription _
) As Queue
'Usage
Dim instance As ServiceBusNamespaceClient
Dim path As String
Dim description As QueueDescription
Dim returnValue As Queue
returnValue = instance.CreateQueue(path, _
description)
public Queue CreateQueue(
string path,
QueueDescription description
)
public:
Queue^ CreateQueue(
String^ path,
QueueDescription^ description
)
member CreateQueue :
path:string *
description:QueueDescription -> Queue
public function CreateQueue(
path : String,
description : QueueDescription
) : Queue
Parameters
- path
Type: System.String
Path of the queue relative to the service namespace base address.
- description
Type: Microsoft.ServiceBus.Messaging.QueueDescription
A QueueDescription object describing the attributes with which the new queue will be created.
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 the 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. |