RouterManagementClient.CreateRouter Method

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

Creates a new router.

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

Usage

    Dim credential As TransportClientEndpointBehavior
Dim routerUri As Uri
Dim routerPolicy As RouterPolicy
Dim returnValue As RouterClient

returnValue = RouterManagementClient.CreateRouter(credential, routerUri, routerPolicy)

Syntax

'Declaration
Public Shared Function CreateRouter ( _
    credential As TransportClientEndpointBehavior, _
    routerUri As Uri, _
    routerPolicy As RouterPolicy _
) As RouterClient
public static RouterClient CreateRouter (
    TransportClientEndpointBehavior credential,
    Uri routerUri,
    RouterPolicy routerPolicy
)
public:
static RouterClient^ CreateRouter (
    TransportClientEndpointBehavior^ credential, 
    Uri^ routerUri, 
    RouterPolicy^ routerPolicy
)
public static RouterClient CreateRouter (
    TransportClientEndpointBehavior credential, 
    Uri routerUri, 
    RouterPolicy routerPolicy
)
public static function CreateRouter (
    credential : TransportClientEndpointBehavior, 
    routerUri : Uri, 
    routerPolicy : RouterPolicy
) : RouterClient

Parameters

  • credential
    The credentials to use for creating the router.
  • routerUri
    The URI of the router 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.
  • routerPolicy
    The policy to assign to the new router will have.

Return Value

Returns a RouterClient that contains the router client.

Example

The following code sample describes how to create a router.

RouterPolicy routerPolicy = new RouterPolicy();
routerPolicy.ExpirationInstant = DateTime.UtcNow + TimeSpan.FromHours(1);

RouterClient client = RouterManagementClient.CreateRouter(credential, routerUri, routerPolicy);
routerPolicy = client.GetPolicy(); // get effective policy

Remarks

Routers 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.

This operation requires ‘Manage’ permission on the given Service Bus namespace URI for the caller.

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

RouterManagementClient Class
RouterManagementClient Members
Microsoft.ServiceBus Namespace