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 re-enable RTDS. 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:

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

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

provides syntax information about sp_msgadmin or about its particular parameters.

sp_msgadmin 'list'

lists syntax information about message providers, logins, or subscriptions using the following options:

sp_msgadmin 'register'

provides stored procedure syntax to register a messaging provider, login, or subscription. The options are:

sp_msgadmin 'remove'

lists the stored procedure syntax to remove a message provider, login, or subscription.

sp_msgadmin 'show'

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

Examples

Example 1

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 2

JMS – logs the level of JVM:

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

Example 3

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

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

Example 4

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

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

Example 5

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

sp_msgadmin 'config', 'jvmmaxthreads', 100

Example 6

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 7

JMS – starts the JVM with 500Mb of RAM by using the -Xmx500m flag:

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

Example 8

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 9

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 10

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 11

JMS – specifies the default login:

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

Example 12

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

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

Example 13

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 14

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 15

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 16

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 17

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 18

JMS – removes the default login:

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

Example 19

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 20

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

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

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

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: