Creating JMS objects
To create JMS or Jakarta Messaging connection factory and destination objects and store
them in a JNDI namespace, use the DEFINE verb. To store your objects in an LDAP
environment, you must give them names that comply with certain conventions. The administration tool
can help you obey LDAP naming conventions by adding a default prefix to object names.
About this task
The DEFINE verb creates an administered object with the type, name, and properties that you specify. The new object is stored in the current context.
The names of JMS or Jakarta Messaging objects that are stored in an LDAP environment must
comply with LDAP naming conventions. One of these conventions is that object and context names must
include a prefix, such as cn= (common name), or ou=
(organizational unit). The administration tool simplifies the use of LDAP service providers by
allowing you to refer to object and context names without a prefix. If you do not supply a prefix,
the tool automatically adds a default prefix to the name you supply. For LDAP, this is
cn=. If required, you can change the default prefix by setting the
NAME_PREFIX property in the configuration file. For more information, see Configuring the JMSAdmin and JMS30Admin tools.
Procedure
Example
- Example: Creating a queue
- The following examples show a queue called
testQueuecreated in the initial context by using theDEFINEverb. Since this object is being stored in an LDAP environment, although the object nametestQueueis not entered with a prefix, the tool automatically adds one to ensure compliance with the LDAP naming convention. Submitting the commandDISPLAY Q(testQueue)also causes this prefix to be added.![[Jakarta Messaging 3.0]](ngjm30.gif)
InitCtx> DEFINE Q(testQueue) InitCtx> DISPLAY CTX Contents of InitCtx a cn=testQueue com.ibm.mq.jakarta.jms.MQQueue 1 Object(s) 0 Context(s) 1 Binding(s), 1 Administered![[JMS 2.0]](ngjms20.gif)
InitCtx> DEFINE Q(testQueue) InitCtx> DISPLAY CTX Contents of InitCtx a cn=testQueue com.ibm.mq.jms.MQQueue 1 Object(s) 0 Context(s) 1 Binding(s), 1 Administered
Example: creating a connection factory with JWT token properties- The following examples show a connection factory called
CONFACTcreated in the initial context using the DEFINE verb.- Example that uses the long names of the TOKEN_CLIENT_ID and TOKEN_ENDPOINT
properties:
DEFINE CF(CONFACT) HOSTNAME(localhost) PORT(1414) CHANNEL(QM1_SVRCONN) TOKENCLIENTID(MyClientID) TOKENENDPOINT(https://keycloak.ibm.com:8080/api/token) - Example that uses the short names of the TOKEN_CLIENT_ID and TOKEN_ENDPOINT
properties.
DEFINE CF(CONFACT) HOST(localhost) PORT(1414) HOSTNAME(localhost) PORT(1414) CHANNEL(QM1_SVRCONN) TCID(MyClientID) TKEP(https://keycloak.ibm.com:8080/api/token)
- Example that uses the long names of the TOKEN_CLIENT_ID and TOKEN_ENDPOINT
properties:
Example: creating a connection factory when supplying a customized
SSLSocketFactory- The following examples show the usage of properties in defining a connection factory called
CONFACTJWTorCONFACTCCDTwhen an application supplies a customized SSLSocketFactory when retrieving a JWT or CCDTURL from an HTTPS endpoint.- Example using long and short names of TOKEN_HTTPS_CERT_VALIDATION_POLICY:
DEFINE CF(CONFACTJWT) HOSTNAME(localhost) PORT(1414) CHANNEL(QM1_SVRCONN) TOKENCLIENTID(MyClientID) TOKENENDPOINT(https://keycloak.ibm.com:8080/api/token) TOKENCERTVALPOL(ANY)DEFINE CF(CONFACTJWT) HOST(localhost) PORT(1414) CHAN(QM1_SVRCONN) TKCD(MyClientID) TKEP(https://keycloak.ibm.com:8080/api/token) TCVP(ANY) - Example using long and short names of WMQ_CCDT_HTTPS_CERT_VALIDATION_POLICY:
DEFINE CF(CONFACTCCDT) CCDTURL(https://ccdturl.com/CCDT.json) QMANAGER(R93) CCDTCERTVALPOL(ANY) TRANSPORT(CLIENT)DEFINE CF(CONFACTCCDT) CCDT(https://ccdturl.com/CCDT.json) QMGR(R93) CCVP(ANY) TRAN(CLIENT)
- Example using long and short names of TOKEN_HTTPS_CERT_VALIDATION_POLICY: