sp_msgadmin 'list'  sp_msgadmin 'default'

Chapter 4: Real Time Stored Procedures for Administration

sp_msgadmin 'register'

Description

Registers a specified message provider, login, or subscrption.

Syntax

 sp_msgadmin 'register', ’provider’, provider_name, provider_class,
      messaging_provider_URL
 sp_msgadmin 'register', ’login’, provider_name, local_login, 
      provider_login, provider_password [, role_name]
 sp_msgadmin 'register', ’subscription’, subscription_name, endpoint
      [, selector [, delivery_option [, durable_name, client_id]]]

Parameters

‘provider’

Registers a message provider.

provider_name

An alias referring to the messaging provider you are adding, which can be as many as 30 characters in length. In the case of register provider, this is an alias for messaging_provider. In the case of register login, this is the name of a previously registered provider.

provider_class

The class of the messaging provider you are adding; for example, “TIBCO_JMS”.

messaging_provider_URL

The URL of the messaging provider you are registering.

‘login’

Registers a login mapping.

local_login

An Adaptive Server login that maps to the local login.

provider_login

The login name of the messaging provider that local_login maps to when connecting to the message provider.

provider_password

The messaging provider password of the provider_login.

role_name

A SQL role name. If you specify a role_name, the local_login is ignored, and the provider_login and provider_password apply to the role_name.

‘subscription’

Registers a subscription.

subscription_name

The name of the subscription you are registering.

end_point

The topic to which the subscription is addressed. See the description of end_points in msgsend.

selector

A message filter that allows a client to select messages of interest. See the description of filters in msgrecv.

delivery_option

One of “local,” “nonlocal,” or null. If the value is null it is assumed to be local. If you specify “local,” a given SQL session can consume messages that it publishes. If you specify “nonlocal,” a specified SQL session cannot consume messages that it publishes.

durable_name

A character string value. See the description of client_id, below.

client_id

The identification used by the messaging provider to identify the subscription as durable. client_id is a character string value. If either client_id or durable_name is specified, the other must also be specified, and the subscription is a durable subscription. Otherwise, it is a nondurable subscription.

The client_id and durable_name combination identifies durable subscriptions with the message provider, and must be unique. No two subscriptions can have the same client_id and durable_name.

client_id uniqueness extends across the messaging provider. JMS allows a particular client_id to be connected only once at any given time. For instance, if one application already has a durable subscription using a specified client_id, the client_id specified by another application should not be the same, if the applications are to be connected at the same time.

A durable subscription exists even when the client is not connected. The messaging provider saves messages that arrive even while the client is not connected.

A nondurable subscription exists only while the client is connected. The messaging provider discards messages that arrive while the client is not connected.

In the following example, sp_msgadmin registers a durable subscription named durable_sub1, Then sp_msgadmin 'list' displays information about the new subscription.

sp_msgadmin
     ’register’, ’subscription’,’durable_sub1’,
     ’my_jms_provider?topic=topic.sample’,
     null, null, ’durable1’, ’client1’
sp_msgadmin ’list’, ’subscription’, ’durable_sub1’

Examples

Example 1

Registers the messaging provider “my_jms_provider”:

sp_msgadmin ’register’, ’provider’, ’my_jms_provider’, ’TIBCO_JMS’,
     ’tcp://10.23.233.32:4823’

Example 2

Registers the login “ase_login1”, using messaging provider login “jms_user1”, and messaging provider name “my_jms_provider”:

sp_msgadmin ’register’, ’login’, ’my_jms_provider’, ’ase_login1’,
     ’jms_user1’, ’jms_user1_password’

Example 3

Registers a login with the messaging provider login “jms_user1”, and a specified password used for all Adaptive Server logins that have sa_role permissions:

sp_msgadmin ’register’, ’login’, ’my_jms_provider’, null, 
     ’jms_user1’, ’jms_user1_password’, ’sa_role’

Example 4

Registers a login using the messaging provider login “jms_user1”, and a specified password used for all unmapped Adaptive Server logins:

sp_msgadmin ’register’, ’login’, ’my_jms_provider’, null, ’jms_user1’,
     ’jms_user1_password’

Example 5

Registers “subscription_1”, a nondurable subscription.

sp_msgadmin ’register’, ’subscription’, ’subscription_1’,
     ’my_jms_provider?topic=topic.sample’

Note“my_jms_provider” must be a provider that you have previously registered, using sp_msgadmin register, provider.

Usage

Permissions

You must have messaging_role and sso_role permissions to issue sp_msgadmim ‘register’.





Copyright © 2004. Sybase Inc. All rights reserved. sp_msgadmin 'default'

View this book as PDF