Share via


QueueManagementClient.CreateQueue Method

[This is prerelease documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Creates a new Queue.

Namespace: Microsoft.ServiceBus
Assembly: Microsoft.ServiceBus (in microsoft.servicebus.dll)

Usage

    Dim credential As TransportClientEndpointBehavior
Dim queueUri As Uri
Dim queuePolicy As QueuePolicy
Dim returnValue As QueueClient

returnValue = QueueManagementClient.CreateQueue(credential, queueUri, queuePolicy)

Syntax

'Declaration
Public Shared Function CreateQueue ( _
    credential As TransportClientEndpointBehavior, _
    queueUri As Uri, _
    queuePolicy As QueuePolicy _
) As QueueClient
public static QueueClient CreateQueue (
    TransportClientEndpointBehavior credential,
    Uri queueUri,
    QueuePolicy queuePolicy
)
public:
static QueueClient^ CreateQueue (
    TransportClientEndpointBehavior^ credential, 
    Uri^ queueUri, 
    QueuePolicy^ queuePolicy
)
public static QueueClient CreateQueue (
    TransportClientEndpointBehavior credential, 
    Uri queueUri, 
    QueuePolicy queuePolicy
)
public static function CreateQueue (
    credential : TransportClientEndpointBehavior, 
    queueUri : Uri, 
    queuePolicy : QueuePolicy
) : QueueClient

Parameters

  • credential
    The credentials to use for creating the Queue.
  • queueUri
    The URI of the queue to create. The URI must use the ‘sb’ scheme and must be in a valid, unoccupied Service Bus namespace location that the caller has ‘Manage’ permissions on.
  • queuePolicy
    The policy to assign to the new queue.

Return Value

Returns a QueueClient for interacting with the Queue.

Example

Uri queueUri = ServiceBusEnvironment.CreateServiceUri("sb", solutionName, "/MyQueue/");

QueuePolicy queuePolicy = new QueuePolicy();
queuePolicy.ExpirationInstant = DateTime.UtcNow + TimeSpan.FromHours(1);

QueueClient client = QueueManagementClient.CreateQueue(credential, queueUri, queuePolicy);
queuePolicy = client.GetPolicy(); // get effective policy

Remarks

Queues are created specifying a policy and using a URI that indicates its location in the Service Bus Namespace. The URI must be constructed using the ‘sb’ URI scheme.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003 , Windows Server 2008, and Windows 2000

Target Platforms

See Also

Reference

QueueManagementClient Class
QueueManagementClient Members
Microsoft.ServiceBus Namespace