IBM Websphere MQ 基础1:QM队列管理器

概念

A queue manager is a program that provides messaging services to applications. Applications that use the Message Queue Interface (MQI) can put messages on queues and get messages from queues. The queue manager ensures that messages are sent to the correct queue or are routed to another queue manager. The queue manager processes both the MQI calls that are issued to it, and the commands that are submitted to it (from whatever source). The queue manager generates the appropriate completion codes for each call or command.

队列管理器是对外提供消息服务的program。应用程序使用MQI接口能发送消息至队列,也能从队列获取消息。队列管理器确保消息被发射至正确的队列或路由(转发)至其他队列管理器。队列管理器能既能处理通过MQI调用发布issue的消息,也能处理通过命令提交commit的消息,同时产生相应的返回值。

The queue managers are the main components in a WebSphere® MQ messaging network. The queue managers host the other objects in the network, such as the queues and the channels that connect the queue managers together. A queue manager must be running to perform the following tasks:

队列管理器是WebSphere® MQ消息网络中最主要的组件,其管理网络中其他对象,如queue(队列)、channel(通道)等;队列管理器必须被启动已提供下列服务:

  • Start channels ----启动通道
  • Process MQI calls ----处理MQI调用
  • Create, delete, alter queues and channel definitions ---创建/删除/修改队列或通道定义
  • Run a command server to process MQSC commands ---运行命令服务以处理MQSC命令

基本命令

  • 创建队列管理器
    crtmqmMQ_ZAVIER
  • 启动队列管理器
    strmqm MQ_ZAVIER
  • 删除队列管理器
    dltmqm MQ_ZAVIER
  • 停止队列管理器
    endmqm MQ_ZAVIER
  • 查看队列管理器信息(如状态信息、安装实例信息等)
    dspmq -o all -m MQ_ZAVIER
  • 查看队列管理器配置信息
    dspmqinf MQ_ZAVIER
  • 在指定QM上运行MQ命令
    runmqsc MQ_ZAVIER
  • 启动QM的监听器
    runmqlsr -m MQ_ZAVIER -p 1415 -t tcp

 一个完整的例子

1. mqm用户视图下:
    1.1 创建QM,名称为QM_T24_CMB
        crtmqm -lp 15 -ls 5 -lc -lf 10240 QM_T24_CMB 
            -lc   Use circular logging.
            -lp  (LogPrimaryFiles)primary log file的数量
            -ls  (LogSecondaryFiles)secondary log file的数量
            -lf   指定log文件页大小
            QM_T24_CMB      QM名
    1.2 启动/运行QM
        strmqm QM_T24_CMB   
    1.3 运行QM的命令行
        runmqsc QM_T24_CMB

2. QM_T24_CMB的命令行视图下:
    2.1 本地队列(若有修改命名,请指示)
        def ql(‘Q.RISKCTRL.REQU.INQ’) maxdepth(5000) DEFPSIST(YES)
        def ql(‘Q.RISKCTRL.RESP.OUQ') maxdepth(5000) DEFPSIST(YES)
    2.2 监听器
        def listener(LSR.T24) trptype(tcp) control(qmgr) port(1415)
    2.3 修改通道属性
        alter qmgr chlauth(disabled) 
        alter chl(SYSTEM.DEF.SVRCONN) chltype(svrconn) mcauser('mqm')

3. 退出QM的命令视图
    end

4. 启动QM监听,其中1415是端口号,如有修改,请指示。
    runmqlsr -m QM_T24_CMB -p 1415 -t tcp 
    
5. 显示QM运行状态
dspmq

显示结果

 


版权声明:本文为zhaogang1993原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。