概念

WebSphere® MQ uses two different types of channels:

  • A message channel, which is a unidirectional communications link between two queue managers. WebSphere MQ uses message channels to transfer messages between the queue managers. To send messages in both directions, you must define a channel for each direction.

消息通道,一种两个QM之间的无向通信连接。WebSphere MQ通过消息通道在队列管理器之间传输信息。

  • An MQI channel, which is bidirectional and connects an application (MQI client) to a queue manager on a server machine. WebSphere MQ uses MQI channels to transfer MQI calls and responses between MQI clients and queue managers.

MQI通道,一种双向的、提供MQI客户端到QM的连接的通道。WebSphere MQ利用MQI通道传输MQI调用,并为MQI-client与QM之间的通信提供服务。

When referring to message channels, the word channel is often used as a synonym for a channel definition. It is usually clear from the context whether we are talking about a complete channel, which has two ends, or a channel definition, which has only one end.

Message channels

Message channel definitions can be one of the following types:

Message channel definition type

Description

Sender

发送通道

A sender channel is a message channel that the queue manager uses to send messages to other queue managers. To send messages using a sender channel, you must also create, on the other queue manager, a receiver channel with the same name as the sender channel. You can also use sender channels with requester channels if you are implementing a "callback" mechanism.

发送通道用于一个QM发送消息至另外一个QM,接收MQ必须创建与发送QM同名的接收通道。也可以同时使用请求通道和发送通道实现回调机制。

Server

服务器通道

A server channel is a message channel that the queue manager uses to send messages to other queue managers. To send messages using a server channel, you must also create, on the other queue manager, a receiver channel with the same name as the server channel. You can also use server channels with requester channels. In that case, the requester channel definition at the other end of the channel requests the server channel definition to start. The server sends messages to the requester. The server can also initiate the communication as long as the server knows the connection name of the partner channel.

服务通道用于一个QM发送消息至另外一个QM,接收MQ必须创建与发送QM同名的接收通道。

Receiver

接收者通道

A receiver channel is a message channel that the queue manager uses to receive messages from other queue managers. To receive messages using a receiver channel, you must also create, on the other queue manager, a sender or a server channel with the same name as this receiver channel.

Requester

请求者通道

A requester channel is a message channel that the queue manager uses to send messages to other queue managers. To send messages using a requester channel, you must also create, on the other queue manager, a sender channel if you are implementing a callback mechanism, or a server channel.

Cluster-sender

A cluster-sender (CLUSSDR) channel definition defines the sending end of a channel on which a cluster queue manager can send cluster information to one of the full repositories. The cluster-sender channel is used to notify the repository of any changes to the queue manager's status, for example the addition or removal of a queue. It is also used to transmit messages. The full repository queue managers themselves have cluster-sender channels that point to each other. They use them to communicate cluster status changes to each other. It is of little importance which full repository a queue manager's CLUSSDR channel definition points to. After the initial contact has been made, further cluster queue manager objects are defined automatically as required so that the queue manager can send cluster information to every full repository, and messages to every queue manager. For more information, see Queue manager clusters.

Cluster-receiver

A cluster-receiver (CLUSRCVR) channel definition defines the receiving end of a channel on which a cluster queue manager can receive messages from other queue managers in the cluster. A cluster-receiver channel can also carry information about the cluster—information destined for the repository. By defining the cluster-receiver channel, the queue manager indicates to the other cluster queue managers that it is available to receive messages. You need at least one cluster-receiver channel for each cluster queue manager. For more information, see Queue manager clusters.

For each channel you must define both ends so that you have a channel definition for each end of the channel. The two ends of the channel must be compatible types.

You can have the following combinations of channel definitions:

  • Sender–Receiver
  • Server–Receiver
  • Requester–Server
  • Requester–Sender (callback)
  • Cluster-sender–Cluster-receiver

Message channel agents(MCA)

Each channel definition that you create belongs to a particular queue manager. A queue manager can have several channels of the same or different types. At each end of the channel is a program, the message channel agent (MCA). At one end of the channel, the caller MCA takes messages from the transmission queue and sends them through the channel. At the other end of the channel, the responder MCA receives the messages and delivers them to the remote queue manager.

通道的两端是一个称为MCA(消息通道代理)的程序。Caller MCA(通道的一端)从传输队列中获取消息并通过通道发送,(responder MCA)通道的另一端结束消息并将其派发到远端队列管理器。

A caller MCA can be associated with a sender, server, or requester channel. A responder MCA can be associated with any type of message channel.

caller MCA能与sender、server、requester通道关联,responseer MCA能与任何类型的消息通道关联。

WebSphere MQ supports the following combinations of channel types at the two ends of a connection:

WebSphere MQ所支持的通道类型组合如下:

Caller

Direction of message flow

Responder

Channel type

Listener required?

 

Listener required?

Channel type

Sender

No

Caller to Responder

Yes

Receiver

Server

No

Caller to Responder

Yes

Receiver

Server

No

Caller to Responder

Yes

Requester

Requester

No

Responder to Caller

Yes

Server

Requester

Yes

Responder to Caller

Yes

Sender

MQI channels

MQI channels can be one of the following types:

MQI通道有两种类型:

MQI channel type

Description

Server connection

服务器连接

A server connection channel is a bidirectional MQI channel that is used to connect a WebSphere MQ client to a WebSphere MQ server. The server connection channel is the server end of the channel.

服务器连接通道是一种用于连接WebSphere MQ client和WebSphere MQ server的双向MQI通道,是服务器端的连接通道。

Client connection

A client connection channel is a bidirectional MQI channel that is used to connect a WebSphere MQ client to a WebSphere MQ server. WebSphere MQ Explorer also uses client connections to connect to remote queue managers. The client connection channel is the client end of the channel. When you create a client-connection channel, a file is created on the computer that hosts the queue manager. You must then, copy the client-connection file to the WebSphere MQ Client computer.

客户端连接通道是一种用于连接WebSphere MQ client和WebSphere MQ server的双向MQI通道。WebSphere MQ Explorer也是应用客户端连接通道去连接远程QM,是客户端的连接通道。

一个完整的例子(配置QM将消息发送远程QM)

架构图:

架构图:

QM_ZAVIER                              ---->>                      QM_ZAVIER2

QM_APPLE(本地队列)                                   Q1(本地队列)

Q1(远程队列)

第一阶段:发送队列管理器与监听器创建/启动

  1. 创建发送QM
    crtmqm -q QM_ZAVIER
  2. 启动发送QM
    strmqm QM_ZAVIER
  3. 创建监听器
    runmqsc QM_ZAVIER
    def listener(LISTENER.ZAVIER) trptype(tcp) control(qmgr) port(1417)
  4. 启动监听器
    start LISTENER(LISTENER.ZAVIER)

第二阶段:发送端本地队列/远程队列创建

  1. 运行命令行
    runmqsc QM_ZAVIER
  2. 创建本地队列QM_APPLE
    define qlocal(QM_APPLE) usage(xmitq)
    说明:usage表示队列用法,填normal代表本地队列,填xmitq代表传输队列
  3. 创建远程队列
    define qremote (Q1) rname (Q1) rqmname(QM_ZAVIER2) XMITQ(QM_APPLE)
    其中:
    qremote:是在本地QM(QM_ZAVIER)创建的归属于远程QM(QM_ZAVIER2)远程队列定义;
    rname:是远程QM(QM_ZAVIER2)中的本地队列;
    rqmname:是远程QM名;
    XMITQ:本地队列管理器用来将消息发送至远程队列管理器的传输队列的名称。本例中为填QM_APPLE。

第三阶段:接收队列管理器的创建/启动、接收队列

  1. 创建接收管理器
    crtmqm -q QM_ZAVIER2
  2. 启动接收管理器
    strmqm QM_ZAVIER2
  3. 创建并启动监听器
    runmqsc QM_ZAVIER2
    def listener(LISTENER.ZAVIER2) trptype(tcp) control(qmgr) port(1418)
    start LISTENER(LISTENER.ZAVIER2)
  4. 创建接收端的本地队列(测试表明:接收端usage(xmitq)不需要)
    define qlocal(Q1) usage(xmitq)

第四阶段:双方通道的创建

  1. 接收端通道
    define channel(ZAVIER.ZAVIER2) chltype (RCVR) trptype (TCP)
  2. 发送端通道
    define channel(ZAVIER.ZAVIER2) chltype (sdr) conname ('127.0.0.1(1418)') xmitq(QM_APPLE) trptype(tcp)
  3. 启动发送端通道
    start channel(ZAVIER.ZAVIER2)

注意:

  • 发送端、接收端通道名必须相同;
  • chltype表示通道类型。RCVR表示Receiver、sdr表示Sender,还有SVR(server)、SVRCONN(server-connection)、CKYSSDR(cluster-sender)等。具体可选值有以下集中:

SDR | SVR | RCVR | RQSTR | CLNTCONN | SVRCONN | CLUSSDR | CLUSRCVR | MQTT*

  • conname表示连接名,格式为:computer_name(port_number),其中,computer_name 是托管该目标队列管理器的计算机的名称或 IP 地址,port_number 是该目标队列管理器的侦听器正在使用的端口。--接收端IP地址与监听端口;
  • xmitq:传输队列名
  • trptype:传输协议类型

测试

1. 发送端amqsput

2. 接收端amqsget

注意:用amqsget、amqsput测试时需要区分大小写(在队列管理器的runmqsc界面下不用区分),因为这是在Linux视图下。

参考:

IBM Websphere MQ _02 MQ消息队列、通道、消息的创建及传输

IBM Websphere MQ 基础4:Channel通道与MQ间消息传输相关推荐

  1. IBM Websphere MQ 基础0:Linux下安装IBM MQ 7.5

    背景 无.公司就是用的IBM WebSphere MQ作为消息中间件,本文记载how install it. 一. 安装包检查与准备 1. 检查 通过rpm –qa检查是否已经安装 IBM MQ,若已 ...

  2. IBM WebSphere MQ 7.5基本用法

    一.下载7.5 Trial版本 http://www.ibm.com/developerworks/downloads/ws/wmq/ 这是下载网址,下载前先必须注册IBM ID,下载完成后一路Nex ...

  3. IBM WebSphere MQ安装及使用教程

    IBM WebSphere MQ安装及使用教程 Linux下websphere MQ安装 #软件安装目录 mkdir /opt/mqm #添加用户组mqm groupadd mqm useradd - ...

  4. spring boot整合IBM WebSphere MQ,并配置多个队列管理器

    IBM WebSphere MQ概述 网上关于IBM WebSphere MQ的资料挺少的,毕竟是一项老技术,整理一下从零开始对于IBM WebSphere MQ的理解 IBM WebSphere M ...

  5. java 集成ibm mq 教程_Spring Boot JMS与IBM WebSphere MQ集成配置

    Spring Boot JMS与IBM WebSphere MQ集成配置 [TOC] 前言 Spring Boot作为简化Spring开发的框架,已经为我们集成了ActiveMQ和RabbitMQ.只 ...

  6. 配置IBM WebSphere MQ及注意事项

    配置IBM WebSphere MQ及注意事项 安装IBM WebSphere MQ 搭建测试环境 遇到的问题 配置IBM WebSphere MQ及注意事项 在项目中用到IBM WebSphere ...

  7. IBM Websphere mq消息队列的理解

    这篇文章用于加深对MQ发送接收信息的理解,有错误之处请评论区予以指点,多谢 *MQ配置 一.双方定义 首先MQ是用来通信的,所以会有收发消息的双方,我们假设,发送消息的A,与接收消息的B 二.A方配置 ...

  8. Hyperic HQ监控IBM WebSphere MQ

    2019独角兽企业重金招聘Python工程师标准>>> IBM公司的WebSphere MQ(MQSeries的前身)是一个信息服务器,使您可以轻松地在不同平台交流信息,整合新的和现 ...

  9. IBM WebSphere MQ 常见报错码及解决方案

    在IBM WebSphere MQ的使用过程中会遇见的常见报错描述和初步解决方案,希望能帮助各位解决使用中可能存在的问题. 序号 错误编号1 原因 1 2033 可能由于队列为空,取不到值引起的 2 ...

最新文章

  1. SCLS:中科院遗传发育在拟南芥二半萜类化合物调控根系微生物组取得突破进展
  2. 简析正则表达式的使用
  3. 学习旧岛小程序 (5) 自定义组件的自定义事件
  4. UILable的text设置中划线(删除线)
  5. where used list repository table WBCROSSGT
  6. 大摩维持浩大游戏“增持”评级
  7. project ‘org.springframework.boot:spring-boot-starter-parent:2.1.4.RELEASE‘ not found
  8. 1 小时顶 7 天!程序员工作中的巧思
  9. 借鸡生蛋术–砍价小程序的推广变现教学
  10. java实现支付宝网页扫码支付
  11. 常用坐标系汇总(更新)
  12. Android Studio的代码笔记--基本使用、新建一个项目、修改快捷键、常用控件的使用等
  13. SOEM主站simple_test之ec_send_processdata
  14. Qt如何自适应4k这些高分辨率屏幕
  15. 杰里混响调MIC增益和深度【篇】
  16. 初级程序员与高级程序员
  17. Flutter - flutter_bloc状态管理
  18. linux赛门铁克扫描,赛门铁克数据扫描程序(Symantec Data Scanner, SDS)技术简介
  19. 四时田园杂兴·昼出耘田夜绩麻
  20. cimoc 最新版_cimoc1.6.1版本下载-cimoc1.6.1最新版_5577安卓网

热门文章

  1. 用爬虫获取网易云音乐热门歌手评论数
  2. vue+photoswipe
  3. 人生苦短我用python壁纸_人生苦短,我用 Python——我如何用 Python 助力工作和生活?...
  4. 基于安全芯片NRSEC3000的输电设备状态监测系统介绍
  5. ubuntu上搭建rtt开发环境并编译2K1000 bsp
  6. 使用AutoCAD画PCB封装和板框
  7. 大数据之kafka简介
  8. MySQL最全整理!高级java开发工程师面试题
  9. 软件项目管理之七:产品规格说明书
  10. nginx启动命令以及与配置systemctl