MQ configuration and remote communication

xiaoxiao2021-03-06  17

The purpose of this example is to establish a pair of MQ servers that enable messaging, which are based on NT and UNIX platforms, respectively.

First build a queue manager at NT

Crtmqm -q qm_nt

Start queue manager

Strmqm QM_NT

Run the MQ console command

Runmqsc QM_NT

Create a dead letter queue

Define QL (NT.DEADQ) Defpsist (YES) REPLACE

Change the Queen Manager property and set its dead letter queue

Alter QMGR Deadq (NT.DEADQ)

Create a process definition

Define Process

AppLtype (WindowsNT)

Applicid ('Runmqchl -c SDR_NT -M QM_NT')

Create a local transmission queue

Define QL (QT_NT) Usage (xmitq) Defpsist (Yes)

INITQ (System.Channel.initq)

Process (p_nt) Replace

Create a remote queue definition, corresponding to the local queue Q_Unix on the UNIX machine, the transfer queue is Qt_NT

Define QRemote (QR_NT)

RNAME (Q_Unix) RQMNAME (QM_Unix)

Xmitq (QT_NT)

Create a sender channel, its transmission queue is qt_nt, the remote host address is 10.10.10.2, the listening port is 1414

Define Channel (SDR_NT) CHLTYPE (SDR)

Conname ('10.10.10.2 (1414) ') XMitq (Qt_NT) Replace

Create a server connection channel

Define Channel (S_NT) CHLTYPE (SVRCONN) REPLACE

Create queue manager in UNIX

Crtmqm -q qm_unix

Start queue manager

Strmqm QM_Unix

Add a listener

Modify the / etc / services file, join a line:

MQSeries 1414 / TCP # MQSeries Channel Listener

Modify the /etc/inetd.conf file, join a line (start the listener)

MQSeries Stream TCP NOWAIT MQM / USR / LPP / MQM / BIN / AMQCRSTA AMQCRSTA -M QM_UNIX

Run the following command to make modifications

Refresh -s inetd

Run the MQ console command

Runmqsc QM_Unix

Create a dead letter queue

Define QL (UNIX.deadq) Defpsist (Yes) Replace

Change the Queen Manager property and set its dead letter queue

Alter QMgr Deadq (UNIX.DEADQ)

Create a recipient channel, its name must be the same as the remote sender

Define Channel (SDR_NT) CHLTYPE (RCVR) Replace

Create a local queue

Define QL (Q_Unix) Defpsist (YES) Replace

Create a server connection channel

DEFINE CHANNEL (S_UNIX) CHLTYPE (SVRCONN) Replace After the above operation, the remote connection is completed. Next, you need to verify that the configuration is correct.

Start the sender channel in the NT end

Runmqchl -c SDR_NT -M QM_NT or START CHL (SDR_NT)

Send a message from the NT side to UNIX

amqsput qr_nt qm_nt

Receive messages on UNIX

/ usr / mqm / samp / bin / amqsget Q_Unix QM_Unix

If you can receive a message, the configuration is successful.

In addition, in NT, the listener is automatically established when the queue manager is established, and the listener is automatically started when the queue manager is started. Of course, you can also manually configure the listener.

Modify / Winnt / System32 / Drivers / etc / services file, add a line in the file:

MQSeries 1414 / TCP # MQSeries Channel Listener

Start listening program

Runmqlsr -t tcp -p 1414 -m qm_nt

The above explains how to establish a simple one-way transmission network. The message is sent from the NT terminal to the UNIX terminal. Establish a remote connection from UNIX to the NT side, which is similar, and the same reason is to establish a two-way transport network.

转载请注明原文地址:https://www.9cbs.com/read-44246.html

New Post(0)