My MQ notes

Source: Internet
Author: User
Tags ibm mq
1. install IBM mq1.1. Prerequisites:

(1) WebSphere eclipse platform v3.01

(2) Configure WebSphere MQ users for Windows Domain Users

1.2. Installer:

(1) Acceptance Agreement:

 

(2) Select 'customer' as the installation type ':

 

(3) change the folder location:

 

(4) data folder location:

 

(5) location of the IBM Global Security kit folder:

 

(6) log folder location:

 

(7) install all the function options (the MQ Resource Manager is installed by default)

 

(8) Start Installation

 

(9) Exit the system after installation;

1.3 install the MQ patch:

(1) Do the following before installing the patch:

Endmqm-P Queue Manager name

Endmqlsr-M queue manager name

Stop MQ Service

 

 

(2) After the MQ patch is installed, it is similar to a Windows Patch. You can manually remove the patch,

 

 

 

 

 

 

 

 

2. Introduction to ibm mq objects 2.1. Message:

The communication program uses messages to exchange data. If the sender constructs a message, the message should include:

-Data to be sent

-Message Header (control information, such as Message ID and return address)

Messages delivered by MQ are composed of two parts:Message Descriptor(Messagedescriptor)And Application Data(Applicationdata). DefaultThe maximum Message Size is4 MB, You can set as needed,Maximum allowed100 MB.

 

2.2 queue:

A queue is the storage location where a message is stored before it is received by the program. The sender puts the message in the appropriate queue. When the receiving program is ready, it obtains the message from the queue.

There are four types:Local queue(Localqueue)Remote Queue(Remotequeue), Alias queue(Aliasqueue)And model queue(Modelqueue)Local and remote queues are most commonly used.

 

2.3. channels:

Provides the data transmission path from one queue manager to other queue managers. There are several channel types, which are commonly usedSender Channel(Senderchannel)And receiver Channel(Receiverchannel).

 

2.4 Queue Manager:

Each computer in the supervisor queue needs the queue manager. Each queue manager has a unique name and manages the queues created on the queue manager (these queues are called local queues ).

Each local queue also has a name, which together with the name of Its Queue Manager provides a unique address that can be sent to messages.

 

2.5. MQ Resource Manager:

The WebSphere MQ resource manager can manage remote queue managers running on Windows, UNIX, Linux, OS/400, Z/series, and other platforms.

 

 

 

3. MQ mqsc command format:

Mqsc command define (used to define objects, such as queues), display (used to display object attributes, such as the number of messages in the queue), and clear (used to remove messages from the queue ). For details, see the following table:

3.1 create a queue manager

Crtmqm-Q qmgrname

-Q refers to the creation of the default queue manager.

Eg: crtmqm-Q sunny

 

3.2 Delete the queue manager

Dltmqm qmgrname

Eg: dltmqm sunny

 

3.3 start the queue manager

Strmqm qmgrname

If you want to start the default Queue Manager, do not include its name.

Eg: strmqm qm_8

 

3.4 stop the queue manager

(1) controlled end of endmqm qmgrname

(2) The endmqm-I qmgrname is stopped immediately.Eg: endmqm-I qm_8

(3) Forced stop of endmqm-P qmgrnameEg: endmqm-P qm_8

 

3.5 display the queue manager

Dspmq-M qmgrname

Eg: dspmq-M qm_0

C: \ Documents and Settings \ sfexpress> dspmq-M qm_nt

Qmname (qm_nt) status (Running)

 

3.6 put messages in the queue

Amqsput QNAME qmgrname ------------------- store the input information in the QNAME queue

If the queue is a queue in the default queue manager, the queue manager name is not required.

Eg:Amqsput rq_8 qm_0 (Store messages in a remote queue)

 

3.7 retrieve messages from the queue

Amqsget QNAME qmgrname ------------------- retrieve messages from the QNAME queue

If the queue is a queue in the default queue manager, the queue manager name is not required.

Eg:Amqsget lq_8 qm_8 (Retrieve messages from the local queue)

 

3.8 start the channel

Runmqchlorophyll-C chlname-M qmgrname

Eg:Runmqchlorophyll-C 8.0-M qm_8 (StartQm_8Under the queue manager8.0Channel)

 

3.9 start listening

Runmqlsr-T type-P port-M qmgrname

 

3.10. stop listening.

Endmqlsr-M qmgrname

Eg:Endmqlsr-M qm_8 -------Stop Queue ManagerQm_8Listener on

 

3.11 run the MQSeries command

Runmqsc qmgrname

If it is the default Queue Manager, its name can be left blank

Eg:Runmqsc qm_8

 

(1) define a dead Message Queue

Define qlocal (QNAME) defpsist (yes) replace

Eg:Define qlocal (q_local) defpsist (yes) replace ---Add a local queueQ_local, Set durability(By ParametersDefpsistOK)

 

Set the dead message queue of the queue manager

Alter qmgr deadq (QNAME)

Eg:Alter qmgr deadq (q_local )----SetQ_localSet as the system default queue manager's dead message queue;

 

(2) define a local queue

Define QL (QNAME) replace ------ a form in which the dead message queue is a local queue

(3) define an alias queue

Define qalias (qaliasname) targq (QNAME)

 

(4) definitions of remote queues

Define qremote (qrname) rname (AAA) rqmname (qmgrname) xmitq (qtname)

Note:Qremote (qrname)--- Indicates the local Remote Queue name.

Rname (AAA)---- Indicates the name of the local queue at the receiving end.

Rqmname (qmgrname)----- Receiver Queue Manager name

Xmitq (qtname )---------Local Transmission queue name

(5) define a local transmission queue

Define qlocal (qtname) usage (xmitq) defpsist (yes) initq (system. Channel. initq) process (processname) replace

Eg:

 

(6) create a process definition

Define process (proname) descr ('string') appltype (WindowsNT) applicid ('runmqchlorophyll-C sdr_test-m qm _ test ')

The appltype value can be CICs, UNIX, windows, WindowsNT, etc.

 

(7) create a sender Channel

Define channel (sdrname) chltype (SDR) conname ('2017. 100.100.215 (100) ') xmitq (qtname) replace

The chltype can be SDRs, SVR, rcvr, rqstr, clntconn, svrconn, clussdr, and clusrcvr.

Eg:Xmitq (qtname )--------Transmission queue

 

(8) create a receiver Channel

Define channel (SDR _ test) chltype (rcvr) replace

 

(9) create a server connection Channel

Define channel (svrconnname) chltype (svrconn) replace

 

(10) display all attributes of the queue

Display Queue (QNAME) [all]

 

(11) display the selected attributes of the queue

Display Queue (QNAME) descr get put

Display Queue (QNAME) maxdepth curdepth

 

(12) display all attributes of the queue manager

Display qmgr [all]

 

(13) display Process Definitions

Display process (proname)

 

(14) Modifying attributes

Alter qmgr descr ('new description ')

Alter qlocal (QNAME) Put (disabled)

Alter qalias (QNAME) targq (targqname)

 

(15) deleting a queue

Delete qlocal (QNAME)

Delete qremote (qrname)

 

(16) Clear all messages in the queue

Clear qlocal (QNAME)

 

 

 

4. MQ Remote Queue Management 4.1 Establish a server connection channel on the client

Create a dedicated 'server connection' channel on the managed client, as shown below:

Runmqsc qm_0

Define channel (DC. svrconn) chltype (svrconn) mcauser ('20140901 ')

Alter qmgr ccsid (0, 1381)

Endmqm-P qm_0

Strmqm qm_0

Strmqcsv qm_0

 

Note:

(1) channel (DC. svrconn) chltype (svrconn) ----- indicates that the established DC. svrconn type is a server connection;

(2)Mcauser----- The operation user on the Management queue manager has the permission to manage MQ on the managed queue manager. You need to modify the server connection channel DC. the mcauser attribute of svrconn is the operation user on the Management queue manager;

 

4.2 operation steps on the Management Server:

(1) Right-click the 'queue Manager' in the title and choose show/hide queue manager;

 

(2) Click the Add button and enter the name of the queue manager of the managed client, for example, qm_unix. The connection method is direct connection;

 

(3) enter the information of the managed client, such as the host name/IP address, port number (listener port of the managed client), and the name of the server connection channel, as shown below:

 

(4) Click Finish to start the connection. After the connection is successful, the queue manager of a client is displayed in the queue manager,

 

The server connection channel s_unix also displays the status 'running'

 

 

 

5. MQ object backup and recovery

 

5.1 backup

1. decompress the attachment ms03.zip and enter the ms03 directory in DOS mode.

 

2. Backup process:

Saveqmgr-MQueue Management name-FFile Name. TST-S

 

Note:

---- MQueue Management name

---- FText file to which backup information is written

---- SSystem information does not need to be exported

 

Eg:

5.2 recovery

The recovery process is as follows:

(1) create a queue manager: the name of the crtmqm queue management.

 

(2) Start the queue manager: strmqm queue management name

 

(3) Definition of Recovery Channel queue: runmqsc queue management name <file name. TST> Log File .txt

 

Eg: runmqsc qm_unix <D: \ backup. TST> D: \ log.txt;

 

Http://blog.163.com/microsunny_lin/blog/static/24266622200764112832488/

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.