C # Use of IBM websphere MQ,
1. Common terms about websphere MQ (for Websphere MQ7.5)
Queue Manager: a program that provides message passing services for applications. Applications using the Message Queue interface (MQI) can place messages in the queue and obtain messages from the queue. The Queue Manager ensures that messages can be sent to the correct queue or transmitted to another queue manager.
Local queue: the location where the queue manager receives messages.
Transmission queue: a special local queue. When the queue manager sends messages to a queue on the Remote Queue Manager, the transmission queue stores the message locally until the queue on the Remote Queue Manager is available. To create a transmission queue, you only need to create a local queueUsageThe property is changed to "transmission ".
Remote Queue definition: defined on the local queue manager of another queue manager. To send a message to a queue in the Remote Queue Manager, the sender queue manager must have a remote definition of the target queue.
Alias queue: it is an additional definition of an existing queue instead of a queue. For example, when the queue name of the application is different from that of the queue manager. You can create an alias queue to point to the desired queue if it cannot be changed.
Model queue: If you want the queue manager to dynamically create a queue template as needed, when the application tries to place messages in the model queue, the queue manager dynamically creates a local queue with the same name as the model queue.
Sender channel: the message channel used by the queue manager to send messages to other queue managers. To use the sender channel to send messages, you must also create a receiver channel with the same name as the sender channel on another queue manager.
Receiver channel: the message channel used by the queue manager to receive messages from other queue managers. The premise is that a sender channel or server channel with the same name has been created in another queue manager.
Requester channel: the message channel used by the queue manager to send messages to other queue managers. To send messages through the requester channel, you must create a sender channel (callback mechanism) or server channel in another queue manager.
Server channel: the message channel used by the queue manager to send messages to other queue managers. To use the server channel to send messages, you must create a receiver channel with the same name as this server channel in another queue manager.
Server connection channel: the channel through which applications operate on local queues.
2. Create MQ using MQSC
A. Open the command prompt and enter crtmqm QM_APPLE. QM_APPLE is the name of the queue manager.
B. Enter strmqm QM_APPLE to start the queue manager.
C. Enter runmqsc QM_APPLE to enable the MQSC command.
Create a local queue define qlocal (Q1), where Q1 is the name of the local queue.
Enter the end MQSC command.
D. Add the Test message to the local queue. Enter amqsput Q1 QM_APPLE In the cmd command line. The queue depth is 1 in the local queue.
E. retrieve messages from the local queue. Enter amqsget Q1 QM_APPLE In the cmd command line
F. create a server connection channel, enter runmqsc QM_APPLE In the cmd command line, and then enter define channel (CLIENT. QM_APPLE) chltype (SVRCONN) trptype (TCP) mcauser ('admin'), where administrator is the Windows login name (or valid mqm username ). This involves the mq user group. The user group named mqm is installed when websphere mq is installed. Input end.
G. Configure the MQ of the host where the application is located.
H. you can enter start listener (system. default. listener. tcp). The default port is 1414. If the port is used, you can use alert listener (system. default. listener. tcp) trptype (tcp) port (1418), where 1418 indicates the port number you want to change, and then execute start listener (system. default. listener. tcp ).
Next Introduction: c # client sending and receiving