WebSphere MQ Basic Command

Source: Internet
Author: User

--View the MQ version--

Dspmqver

--View queue status--
Dspmq

--Create a queue manager--
Crtmqm-q ECIS_QM

--Delete Queue Manager--
DLTMQM ECIS_QM

--Start the queue Manager--
STRMQM ECIS_QM

--Close the queue Manager--
Endmqm-i ECIS_QM immediately stop
Endmqm-p ECIS_QM Force Stop

--run Queue Manager--
RUNMQSC ECIS_QM

--Definition listener--
DEFINE LISTENER (LSR_4_ECIS_QM) trptype (TCP) PORT (1616) CONTROL (QMGR) REPLACE
START LISTENER (LSR_4_ECIS_QM)

--Define the channel--
DEFINE CHANNEL (ECIS. SVRCONN) Chltype (SVRCONN) MCAUSER (' MQM ') REPLACE

--Start channel--
Runmqchl–c chlname–m ECIS_QM

--Start listening--
Runmqlsr–t tcp–p 1616–m ECIS_QM
Endmqlsr-m ECIS_QM

--Define the queue--
DEFINE QL (q_svc2adp_4_telnet) REPLACE
DEFINE QL (Q_SVC2ADP_4_JDBC) REPLACE
DEFINE QL (q_svc2adp_4_http) REPLACE
DEFINE QL (Q_svc2adp_4_socket) REPLACE

--Delete queue--
Delete QL (q_svc2adp_4_telnet)

--View listener--
Display Listener (LSR_4_ECIS_QM)

--View channel--
Dis CHS (*)

--View local queues--
Display QL (*) [ALL]

--View remote queue--
Display QR (*) [ALL]

--View Queue Depth--
Display QL (q_svc2adp_4_http) curdepth

--Clear Queue message--
Clear QL (q_svc2adp_4_http)

--View ccsid--
Display Qmgr All

--Modify ccsid--
ALTER QMGR [Force] CCSID (5488)

Logical definition
##################################################
./jmsadmin

DELETE QCF (T_ECIS_QCF)

DELETE Q (t_ecis_q_svc2adp_telnet)
DELETE Q (t_ecis_q_adp2svc_telnet)
DELETE Q (T_ECIS_Q_SVC2ADP_JDBC)
DELETE Q (T_ECIS_Q_ADP2SVC_JDBC)

DELETE Q (t_ecis_q_svc2adp_http)
DELETE Q (t_ecis_q_adp2svc_http)
DELETE Q (T_ecis_q_svc2adp_socket)
DELETE Q (T_ecis_q_adp2svc_socket)

DEFINE QCF (T_ECIS_QCF) DESC () TRAN (CLIENT) HOST (10.151.128.13) QMGR (T_ECIS_QM) CHAN (T_ecis. SVRCONN) PORT (2626) CCSID (5488)

DEFINE Q (t_ecis_q_svc2adp_telnet) DESC () QMGR (T_ECIS_QM) QUEUE (q_svc2adp_4_telnet) CCSID (5488)
DEFINE Q (t_ecis_q_adp2svc_telnet) DESC () QMGR (T_ECIS_QM) QUEUE (q_adp2svc_4_telnet) CCSID (5488)
DEFINE Q (T_ECIS_Q_SVC2ADP_JDBC) DESC () QMGR (T_ECIS_QM) QUEUE (Q_SVC2ADP_4_JDBC) CCSID (5488)
DEFINE Q (T_ECIS_Q_ADP2SVC_JDBC) DESC () QMGR (T_ECIS_QM) QUEUE (Q_ADP2SVC_4_JDBC) CCSID (5488)

DEFINE Q (t_ecis_q_svc2adp_http) DESC () QMGR (T_ECIS_QM) QUEUE (q_svc2adp_4_http) CCSID (5488)
DEFINE Q (t_ecis_q_adp2svc_http) DESC () QMGR (T_ECIS_QM) QUEUE (q_adp2svc_4_http) CCSID (5488)
DEFINE Q (T_ecis_q_svc2adp_socket) DESC () QMGR (T_ECIS_QM) QUEUE (q_svc2adp_4_socket) CCSID (5488)
DEFINE Q (T_ecis_q_adp2svc_socket) DESC () QMGR (T_ECIS_QM) QUEUE (q_adp2svc_4_socket) CCSID (5488)


WebSphere MQ common Commands and configurations
##################################################
Create local Queue Q
DEFINE qlocal (q)
Set the maximum depth of local queue Q to 5
ALTER qlocal (Q) MAXDEPTH (5)
Recreate local queue Q if q already exists, reset all its properties to the default properties
DEFINE qlocal (Q) REPLACE
Create a remote queue
DEFINE QREMOTE (qrname) rname (AAA) rqmname (qmgrname) XMITQ (qtname)
Create a transport queue
Define qlocal (Clv_hq_tran) usage (XMITQ) INITQ (SYSTEM. CHANNEL. INITQ) Trigdata (REV_CLV) Trigtype (every) TRIGGER REPLACE
Creating a receive-side channel C
DEFINE CHANNEL (C) chltype (RCVR)
Create the sender channel C, connecting the other IP to the 10.10.10.10 port for the 1414-channel connection to the transmit queue XQ
DEFINE CHANNEL (C) chltype (SDR) CONNAME (' 10.10.10.10 (1414) ') XMITQ (XQ)
Create requester Channel
DEFINE CHANNEL (D) chltype (rqstr) CONNAME (' 10.10.10.10 (1414) ')
Create a server channel
DEFINE CHANNEL (D) chltype (SVR) XMITQ (XQ1)
Create a server connection channel
DEFINE CHANNEL (E) chltype (SVRCONN) REPLACE

Show All remote queues
Display Qremote (*)
Show All Channels
Display Channel (*)

Defining dead-letter queues
DEFINE qlocal (QUEUE) defpsist (YES) REPLACE

To set the queue manager's dead-letter queue
ALTER QMGR DEADQ (QUEUE)

Set the Maxchannels and Maxactivechannels properties (maximum number of connections)
##################################################
The Maxchannels and maxactivechannels represent the maximum number of channels that the Queue Manager allows to configure and the number of channels that are allowed to run concurrently, and the default value for Maxchannels is 100. The default value of Maxactivechannels is the same as maxchannels. If you have more than 100 concurrent channel connections, you need to modify both parameters. This is especially important for inter-client/server communication with large concurrency.
On the UNIX platform, modify the Qm.ini file to add the following (path:/VAR/MQM/QMGRS/HQ_SVR):
Channels:
Maxchannels = 3000 (maximum number of channels)
Maxactivechannels = 3000 (maximum number of active channels)
pipelinelength=2
Adoptnewmca=all
Then restart MQ


To define a persistence queue:
DEFINE qlocal (QNAME) defpsist (YES) REPLACE

Transport Queue Management
##################################################
1: Define the transmission queue
DEFINE qlocal (Q_transfer) USAGE (XMITQ)
Note:
Q_transfer: Transmission queue name

The following defines an input queue with a trigger
DEFINE qlocal (Q_transfer) USAGE (XMITQ) defpsist (YES) INITQ (SYSTEM. CHANNEL. INITQ) Trigdata (Dp_rchannel) REPLACE
Note:
Parameter 1: Transmission queue name (Q_transfer)
Parameter 5: Trigger data (Dp_rchannel), which is the channel to start after triggering.

2: Define triggers on the transmit to queue
Dpcis_q_transfer: Transmission queue
Trigger data: Dp_rchannel, that is: Send Channel, start the channel when triggered
Alter Qlocal (Dpcis_q_transfer) trigdata (' Dp_rchannel ') trigtype (every) TRIGGER initq (' SYSTEM. CHANNEL. INITQ ')

Remote Queue Management
##################################################
Define the remote queue definition by entering the following command:
Define Qremote (Q1) rname (Q1) rqmname (qm_apple) XMITQ (qm_apple)
Note:
Parameter 1: Queue name (Sender remote queue name)
Parameter 2: Remote queue (receiver's local receive queue name)
Parameter 3: Remote Queue Manager (receiver Queue Manager name)
Parameter 4: Transmission Queue (Sender transport queue name)

Channel Management
##################################################
1: Create receiver Channel
DEFINE CHANNEL (sdr_ TEST) chltype (RCVR) REPLACE
Define channel (Q_r_channel2) Chltype (RCVR) Replace
Note:
Parameter 1: Receiver channel name
Replace: Indicates that the channel has been replaced

2: Create Sender Channel
DEFINE CHANNEL (sdrname) chltype (SDR) CONNAME (' 100.100.100.215 (1418) ') XMITQ (qtname) REPLACE
The Chltype can be: SDR, SVR, RCVR, Rqstr, Clntconn, SVRCONN, CLUSSDR, and CLUSRCVR.

Define channel (Dp_rchannel) Chltype (SDR) conname (' 10.101.2.3 (1414) ') XMITQ (q_transfer) Replace
Note:
Channel name: Dp_rchannel (name of sender channel)
Transmission queue: Q_transfer (name of sender transport queue)

3: Start Channel
Start Channel (Qm_orange. Qm_apple)

4: View channel status
Dis CHS (*)

Listener Management
##################################################
1: Defining listeners
DEFINE LISTENER (TCPLS1) trptype (TCP) PORT (1414) REPLACE

2: Start listener
Start Listener (TCPLS1)
3: Display listener information
Display Listener (TCPLS1)

Create Trigger
##################################################
In general, there are two purposes of setting up MQ triggers, one is to automatically start the sending side channel, and the other is to monitor the queue message, and once a new message is found, the corresponding processing process is initiated using the trigger.
If you are using triggers to automatically start a send-side channel, using Method 1, if you are using triggers to start a user process, use Method 2

Method 1
A trigger is set on the transport channel, the trigger control is turned on, and the type is "first"
B the initial queue is SYSTEM.CHANNEL.INITQ, which is listed as an MQ-dedicated channel boot queue and does not need to start its trigger monitor manually
C trigger data is the send-side channel name, such as qag.50
D put the message test in the transport channel when the send-side channel is inactive

Method 2
A creates a trigger boot queue with a template of SYSTEM.DEFAULT.INITIATION.QUEUE
Runmqsc
Define Qlocal (MQ. Triger. Iniqueue) Like (SYSTEM. DEFAULT. Initiation. QUEUE)
B define process the so-called process is the trigger to trigger the program in this case the process name: Triger.program Application ID: "Notepad.exe"
C set a trigger on a queue, typically a local queue, open trigger control, type select "First", "per" or "based on number of messages" according to your own needs
D Initial Queue Select a trigger start queue created in a, for example, MQ.TRIGER.INIQUEUE, the process name is set to the process name defined in B, for example Triger.program
E start trigger monitor runmqtrm-m qagwy-q MQ. Triger. Iniqueue
F put messages in local queue for testing

Method 2 can also do the work of method 1 by changing the application identity in the process definition to runmqchl-m qagwy-c qag.50, but the dedicated channel boot queue is available in MQ.
The queue does not need to manually start the trigger monitor, so the method 1 is less than Method 2, the configuration is simple, so it is better to use the trigger to automatically start the send-side channel, or Method 1.

(GO) WebSphere MQ Basic command

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.