sp_msgadmin

Description

Configures and administers messaging-related information.

Syntax

sp_msgadmin 'config', ['jvmlogging', logging_level 
	| 'jvmpropertyfile', filepath
	| 'jvmlogfile', filepath
	| 'jvmmaxthreads', thread_number
	| 'jvmminthreads', thread_number
	| 'jvmthreadtimeout', thread_timeout
	| 'jvm' , jvm_parameter]
sp_msgadmin 'default', 'login', provider_name, provider_login,
		provider_password
sp_msgadmin 'help'
	[, 'list' | 'register' | 'default' | 'remove']
sp_msgadmin 'list',
	[| 'login'[, provider_name, [login_name] 
	| 'provider' [, provider_name]
	| 'subscription' [, subscription_name]]
sp_msgadmin 'register', 
	['provider', provider_name, provider_class,
		messaging_provider_URL 
	| 'login', provider_name, local_login, provider_login,
		provider_password [, role_name] 
	| 'subscription', subscription_name, endpoint[, selector 
		[, delivery_option [, durable_name, client_id]]]]
sp_msgadmin 'remove', 
	['provider', provider_name 
	| 'login', provider_name, local_login [, role] 
	| 'subscription', subscription_name
sp_msgadmin 'show',
	showtype, provider[, options_clause]

Parameters

sp_msgadmin 'config'

allows you to specify various configurations for either the Java Virtual Machine (JVM), or the key repository file path for Adaptive Server for using MQ SSL. The configured values take effect after you reenable ASE Active Messaging. The options for sp_msgadmin 'config' are:

sp_msgadmin 'default'

specifies a default. In the case of sp_msgadmin 'list', lists the syntax to specify the default login for a specified message provider. The options are:

  • 'login' – when used with 'default' specifies a default login.

    NoteYou cannot use sp_msgadmin 'default', 'login' if endpoint is an MQ queue manager.

  • provider_name – is the messaging provider you are registering, which can be as many as 30 characters in length.

  • provider_login – is the login name of the messaging provider that local_login maps to when connecting to the message provider. provider_login is also the default login the provider uses when sending or receiving messages from the provider_name.

  • provider_password – is the password of the provider_login.

Note(Cluster environment only) If you use sp_msgadmin default to define the default login in a cluster environment, you can use the configuration over the entire cluster.

sp_msgadmin 'help'[, 'list' | 'register' | 'default' | 'remove']

provides syntax information about sp_msgadmin or its parameters.

sp_msgadmin 'list'

lists syntax information about message providers, logins, or subscriptions:

  • 'login'[, provider_name,[login_name] – lists information about a particular messaging provider login mapping, or about all messaging provider logins.

  • 'provider'[, provider_name] – specifies the message provider, and lists information about a particular messaging provider or about all message providers.

  • 'subscription'[, subscription_name] – lists information about a particular subscription or about all subscriptions.

sp_msgadmin 'register'

registers a messaging provider, login, or subscription. The options are:

Note(Cluster environment only) If you use sp_msgadmin ‘register’ in a cluster environment to register provider, login, and subscription information the registration applies to the entire cluster.

sp_msgadmin 'remove'

removes a message provider, login, or subscription.

  • 'provider', provider_name – removes a messaging provider previously defined with:

    sp_msgadmin 'register', 'provider', provider_name
    

    provider_name is an alias referring to the messaging provider you are removing.

  • 'login', provider_name, local_login [, role] – removes the mapping previously created between an Adaptive Server login and a service provider login, defined by this call:

    sp_msgadmin 'register', 'login', local_login,... 
    

    Where:

    • local_login – is an Adaptive Server login that maps to the local login.

    • role – is the role.

  • 'subscription', subscription_name – removes a subscription previously created by:

    sp_msgadmin 'register' 'subscription', subscription_name, ...
    
sp_msgadmin 'show'

requires Adaptive Server version 15.0.2 ESD #1 or later, and displays the information about some MQ objects on a specified queue manager, where:

Examples

Example 1

(JMS) logs the level of JVM:

sp_msgadmin 'config', 'jvmlogging', 'info'

Example 2

(JMS) specifies /usr/1.prop as the properties file:

sp_msgadmin 'config', 'jvmpropertyfile', '/usr/1.prop'

Example 3

(JMS) defines the log file path as $SYBASE/$SYBASE_ASE/rtms.log:

sp_msgadmin 'config', 'jvmlogfile', '$SYBASE/$SYBASE_ASE/rtms.log'

Example 4

(JMS) specifies the maximum number of threads in the JVM server’s thread pool as 100:

sp_msgadmin 'config', 'jvmmaxthreads', 100

Example 5

(JMS) specifies 10 minutes as the amount of time that a thread is idle before it is automatically destroyed:

sp_msgadmin 'config', 'jvmthreadtimeout', 600

Example 6

(JMS) starts the JVM with 500MB of RAM by using the -Xmx500m flag:

sp_msgadmin 'config', 'jvm', '-Xmx500m'

Example 7

(JMS) registers the “eas_1” message provider, which has a class of EAS_JMS and a URL of iiop://localhost:7222:

sp_msgadmin 'register', 'provider', 
    'eas_1','eas_jms','iiop://localhost:7222'

Example 8

(JMS) specifies the default login that applies to all unmapped Adaptive Server logins, when using a specified messaging provider for either sending or receiving:

sp_msgadmin 'default', 'login', 'my_eas','eas_user','eas_password'

NoteYou must first register the provider_name by calling sp_msgadmin 'register', 'provider'.

Example 9

(JMS) specifies the default login:

sp_msgadmin 'default', 'login', 'one_jms_provider', 'loginsa', 
    'abcdef123456'

Example 10

(JMS) lists the details for the user with a login of “loginsa”:

sp_msgadmin 'list', 'login', 'my_jms_provider', 'loginsa'

Example 11

(JMS) 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 12

(JMS) 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 13

(JMS) registers the “my_jms_provider” messaging provider, which has a class of TIBCO_JMS and an IP of 10.23.233.32:4823 as its address:

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

Example 14

(JMS) 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'

Example 15

(JMS) registers “subscription_1,” a nondurable subscription.

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

NoteYou must first use sp_msgadmin register, provider to register “my_jms_provider”.

Example 16

(JMS) removes the default login:

sp_msgadmin 'remove', 'login', 'my_jms_provider'

Example 17

(JMS) removes the Adaptive Server login “ase_login1” associated with the messaging provider “my_jms_provider”:

sp_msgadmin 'remove', 'login', 'my_jms_provider', 'ase_login1'

Example 18

(JMS) removes all logins for role sa_role on “my_jms_provider”:

sp_msgadmin 'remove', 'login', 'my_jms_provider', null, 'sa_role'

Example 19

(MQ) configures the key repository for Adaptive Server to enable the use of SSL, where the key database file path is /var/mqm/clients/ssl/KeyringClient.kdb:

sp_msgadmin 'config', ibmmq_keystore, 
    'var/mqm/clients/ssl/KeyringClient'

Example 20

(MQ) registers the “mq_provider_1” messaging provider, which has a class of IBM_MQ and a URL of chanl1/TCP/host1(5678):

sp_msgadmin 'register', 'provider', 'mq_provider_1', 'ibm_mq', 
    'chanl1/TCP/host1(5678)'

Example 21

(MQ) displays the queue manager name from machine “bigcrunch” with a listening port of 3150:

sp_msgadmin 'show', 'QMGR', 'ibm_mq:/tcp/bigcrunch(3150)'
Name
---------------------------------------------------
TEST

Example 22

(MQ) displays the queue manager name. The queue manager is on machine “bigcrunch” with a listening port of 3150. The reply message is placed in the Q1 queue and the longest that Adaptive Server waits for a reply message is 20 milliseconds:

sp_msgadmin 'show', 'QMGR', 'ibm_mq:channel1/tcp/bigcrunch(3150)',
    'timeout=20, replyqueue=Q1'

Example 23

(MQ) displays all of the queues on the queue manager. The reply message is placed in the Q1 queue and the longest that Adaptive Server waits for a reply message is 20 milliseconds:

sp_msgadmin 'show', 'queues', 'ibm_mq:/tcp/bigcrunch(3150)',
    'timeout=20, replyqueue=Q1'
Name                                                        Type
------------------------------------------------------------------
Q1                                                          LOCAL
SYSTEM.MQSC.REPLY.QUEUE                                     MODEL
RQ1                                                         REMOTE
AQ1                                                         ALIAS
...

Example 24

(MQ) displays all of the channels on the queue manager:

sp_msgadmin 'show', 'channels', 'ibm_mq:/tcp/bigcrunch(3150)'
Name                                                        Type
--------------------------------------------------------------------
SNCH1                                                       SENDER
SECH2                                                       SERVER
RCCH3                                                       RECEIVER
CHL5                                                        SRVCONN
...

Example 25

(SonicMQ) registers a subscription called “sub1” to the specified endpoint, and placed in the Q1 queue:

sp_msgadmin register, subscription, sub1,
    'sonicmq_jms:tcp://mysonic:7223??topic=T1,user=sonic_usr, password=sonic_pwd'

Usage

You cannot use sp_msgadmin inside a transaction.


sp_msgadmin 'register'


sp_msgadmin 'remove'


sp_msgadmin 'config'

Permissions

You must have messaging_role to run the msgsend and msgrecv functions.

You must have messaging_role and sso_role permissions to issue:

Any user can issue: