互联网服务

请教关于MQ发消息对方收不到的问题的解决(单向通讯)

各位好,最近折腾MQ也快一个月了,卡在发送消息不成功也好长时间,能否给在下些提示?我的环境如下:
两台RHEL-5.4-i386
MQ版本:WMQv6023Trial-x86_linux_2.tar.gz
java版本:ibm-java2-sdk-5.0-12.5-linux-i386.tgz
两台都已更新为 java 1.5
发送方的配置如下:
IP:192.1.1.221
管理队列:admin1
本地队列:loca1
远程队列:remote1
define qr (remote1) rname (local2) rqmname (admin2) xmitq (tr1) replace
传输队列:tr1
define ql (tr1) usage (xmitq) defpsist (yes)
发送通道:admin1toadmin2
define chl (admin1toadmin2) chltype (sdr) conname ('192.1.1.222(1414)') xmitq (tr1) trptype (tcp) replace

接收方配置如下:
IP:192.1.1.222
管理队列:admin2
本地队列:loca2
远程队列:remote2
传输队列:tr2
发送通道:admin2toadmin1
接收通道:admin1toadmin2
define chl (admin1toadmin2) chltype (rcvr) replace
定义侦听:
define listener(admin2) trptype(tcp) port(1414) control(qmgr)
之后重启管理队列,侦听生效。

在发送方执行:
ping chl (admin1toadmin2)
    10 : ping chl (admin1toadmin2)
AMQ8020: Ping WebSphere MQ channel complete.

在接收方查看侦听:
display listener (ls2)
     1 : display listener (ls2)
AMQ8630: Display listener information details.
   LISTENER(LS2)                           CONTROL(QMGR)
   TRPTYPE(TCP)                            PORT(1414)
   IPADDR( )                               BACKLOG(0)
   DESCR( )                                ALTDATE(2011-08-25)
   ALTTIME(20.08.40)            

在发送方发送了六条消息后,接收方取不到消息,查看发送方的传输队列:
display ql (tr1)
    11 : display ql (tr1)
AMQ8409: Display Queue details.
   QUEUE(TR1)                              TYPE(QLOCAL)
   ACCTQ(QMGR)                             ALTDATE(2011-08-25)
   ALTTIME(19.54.56)                       BOQNAME( )
   BOTHRESH(0)                             CLUSNL( )
   CLUSTER( )                              CLWLPRTY(0)
   CLWLRANK(0)                             CLWLUSEQ(QMGR)
   CRDATE(2011-08-25)                      CRTIME(19.54.56)
   CURDEPTH(6)                             DEFBIND(OPEN)
   DEFPRTY(0)                              DEFPSIST(YES)
   DEFSOPT(SHARED)                         DEFTYPE(PREDEFINED)
   DESCR( )                                DISTL(NO)
   GET(ENABLED)                            HARDENBO
   INITQ( )                                IPPROCS(0)
   MAXDEPTH(5000)                          MAXMSGL(4194304)
   MONQ(QMGR)                              MSGDLVSQ(PRIORITY)
   NOTRIGGER                               NPMCLASS(NORMAL)
   OPPROCS(0)                              PROCESS( )
   PUT(ENABLED)                            QDEPTHHI(80)
   QDEPTHLO(20)                            QDPHIEV(DISABLED)
   QDPLOEV(DISABLED)                       QDPMAXEV(ENABLED)
   QSVCIEV(NONE)                           QSVCINT(999999999)
   RETINTVL(999999999)                     SCOPE(QMGR)
   SHARE                                   STATQ(QMGR)
   TRIGDATA( )                             TRIGDPTH(1)
   TRIGMPRI(0)                             TRIGTYPE(FIRST)
   USAGE(XMITQ)                        
从以上来看消息在“CURDEPTH(6)”,六条消息,因为我实现的单向通讯,所以我在接收方只定义了本地队列,接收通道和侦听,能否说明下是什么原因???折腾得我都快要泪如雨下了。还望大侠指点迷津!!!!!!!!!
参与33

32同行回答

fang2360fang2360软件架构设计师AGREE
兄弟,应该不是大小写的问题,第一次做的时候我也犯过这个错误。原因如下:你在测试的时候使用了本地的发送队列而不是远程队列发送的消息,所以消息会回到死信队列中,你用远程队列发送测试消息,再试一下。。。。...显示全部
兄弟,应该不是大小写的问题,第一次做的时候我也犯过这个错误。原因如下:
你在测试的时候使用了本地的发送队列而不是远程队列发送的消息,所以消息会回到死信队列中,
你用远程队列发送测试消息,再试一下。。。。收起
IT分销/经销 · 2011-10-20
浏览1254
zhangchao_32zhangchao_32软件开发工程师aaa
我放消息的时候远程队列写的是大写。主要的问题还是我在定义的时候没有按大写来定义,虽然看似消息控制台式自动都转换成大写了,但是实际上可能还是有些差别。多谢各位关注并支持!...显示全部
我放消息的时候远程队列写的是大写。主要的问题还是我在定义的时候没有按大写来定义,虽然看似消息控制台式自动都转换成大写了,但是实际上可能还是有些差别。
多谢各位关注并支持!收起
互联网服务 · 2011-09-26
浏览1215
sangmin214sangmin214系统工程师SS
哦,貌似你的确没说你是怎么放的runmqsc默认把所有的定义都转换成大写显示全部
哦,貌似你的确没说你是怎么放的
runmqsc默认把所有的定义都转换成大写收起
系统集成 · 2011-09-26
浏览1219
zhangchao_32zhangchao_32软件开发工程师aaa
天杀的,原来是大小写的问题,我把所以定义的参数都改为大写后成功了,原以为能自动识别大小写呢。这事折腾得我好苦呀!!!!!!!!!!!重新定义参数为:IP:192.1.1.221队列管理器:ADMIN1def ql (LOCAL1) replacedef ql (TR1) usage (xmitq) defpsist (YES)def qr (REMOTE1) rqmname(ADMIN2) rname...显示全部
天杀的,原来是大小写的问题,我把所以定义的参数都改为大写后成功了,原以为能自动识别大小写呢。这事折腾得我好苦呀!!!!!!!!!!!
重新定义参数为:
IP:192.1.1.221
队列管理器:ADMIN1
def ql (LOCAL1) replace
def ql (TR1) usage (xmitq) defpsist (YES)
def qr (REMOTE1) rqmname(ADMIN2) rname (LOCAL2) xmitq (TR1) replace
def chl (ADMIN1TOADMIN2) chltype (sdr) trptype (TCP) xmitq (TR1) conname ('192.1.1.222(1414)') replace
start chl (ADMIN1TOADMIN2)
def chl (ADMIN2TOADMIN1) chltype (RCVR) replace
def listener (LS1) trptype (TCP) port (1414) control (QMGR)
start listener (LS1)
def ql (DEAD1) replace
alter QMGR deadq (DEAD1)

IP:192.1.1.222
队列管理器:ADMIN2
def ql (LOCAL2) replace
def ql (TR2) usage (xmitq) defpsist (YES)
def qr (REMOTE2) rqmname(ADMIN1) rname (LOCAL1) xmitq (TR2) replace
def chl (ADMIN2TOADMIN1) chltype (sdr) trptype (TCP) xmitq (TR2) conname ('192.1.1.221(1414)') replace
start chl (ADMIN2TOADMIN1)
def chl (ADMIN1TOADMIN2) chltype (RCVR) replace
def listener (LS2) trptype (TCP) port (1414) control (QMGR)
start listener (LS2)
def ql (DEAD2) replace
alter QMGR deadq (DEAD2)

多谢各位关注与支持!!!!!!!!小弟不胜感激!!!!!!!收起
互联网服务 · 2011-09-24
浏览1217
zhangchao_32zhangchao_32软件开发工程师aaa
查看死信队列的消息内容如下: StrucId  : 'MD  '  Version : 2  Report   : 0  MsgType : 8  Expiry   : -1  Feedback : 0  Encoding : 546  CodedChar...显示全部
查看死信队列的消息内容如下:
StrucId  : 'MD  '  Version : 2
  Report   : 0  MsgType : 8
  Expiry   : -1  Feedback : 0
  Encoding : 546  CodedCharSetId : 1208
  Format : 'MQDEAD  '
  Priority : 0  Persistence : 0
  MsgId : X'414D512061646D696E3120202020202032AE7D4E0E0C0020'
  CorrelId : X'000000000000000000000000000000000000000000000000'
  BackoutCount : 0
  ReplyToQ       : '                                                '
  ReplyToQMgr    : 'admin1                                          '
  ** Identity Context
  UserIdentifier : 'mqm         '
  AccountingToken :
   X'0335303000000000000000000000000000000000000000000000000000000006'
  ApplIdentityData : '                                '
  ** Origin Context
  PutApplType    : '6'
  PutApplName    : 'amqsput                     '
  PutDate  : '20110924'    PutTime  : '10363868'
  ApplOriginData : '    '

  GroupId : X'000000000000000000000000000000000000000000000000'
  MsgSeqNumber   : '1'
  Offset         : '0'
  MsgFlags       : '0'
  OriginalLength : '-1'

****   Message      ****

length - 178 bytes

00000000:  444C 4820 0100 0000 2708 0000 4C4F 4341           'DLH ....'...LOCA'
00000010:  4C32 2020 2020 2020 2020 2020 2020 2020           'L2              '
00000020:  2020 2020 2020 2020 2020 2020 2020 2020           '                '
00000030:  2020 2020 2020 2020 2020 2020 4144 4D49           '            ADMI'
00000040:  4E32 2020 2020 2020 2020 2020 2020 2020           'N2              '
00000050:  2020 2020 2020 2020 2020 2020 2020 2020           '                '
00000060:  2020 2020 2020 2020 2020 2020 2202 0000           '            "...'
00000070:  B804 0000 4D51 5354 5220 2020 0600 0000           '....MQSTR   ....'
00000080:  616D 7172 6D70 7061 2020 2020 2020 2020           'amqrmppa        '
00000090:  2020 2020 2020 2020 2020 2020 3230 3131           '            2011'
000000A0:  3039 3234 3130 3336 3338 3637 6466 6466           '092410363867dfdf'
000000B0:  6466                                              'df              '


MQGET of message number 2收起
互联网服务 · 2011-09-24
浏览1228
zhangchao_32zhangchao_32软件开发工程师aaa
为此我再重新定义死信队列:def ql (dead2) defpsist (yes) replacealter qmgr deadq (dead2)再发消息,消息进入死信队列,日志变成如下:09/24/2011 06:38:40 PM - Process(3202.4) User(mqm) Program(amqrmppa)AMQ9544: Messages not put to destination queue.EXPLANATION:Du...显示全部
为此我再重新定义死信队列:
def ql (dead2) defpsist (yes) replace
alter qmgr deadq (dead2)
再发消息,消息进入死信队列,日志变成如下:
09/24/2011 06:38:40 PM - Process(3202.4) User(mqm) Program(amqrmppa)
AMQ9544: Messages not put to destination queue.

EXPLANATION:
During the processing of channel 'ADMIN1TOADMIN2' one or more messages could
not be put to the destination queue and attempts were made to put them to a
dead-letter queue.  The location of the queue is 1, where 1 is the local
dead-letter queue and 2 is the remote dead-letter queue.
ACTION:
Examine the contents of the dead-letter queue.  Each message is contained in a
structure that describes why the message was put to the queue, and to where it
was originally addressed. Also look at previous error messages to see if the
attempt to put messages to a dead-letter queue failed. The program identifier
(PID) of the processing program was '3202'.
这又跟之前的情况一样了,双方相互发送都进入了对方的死信队列。还望各位指点迷津!谢谢!收起
互联网服务 · 2011-09-24
浏览1213
zhangchao_32zhangchao_32软件开发工程师aaa
我重装系统后的新配置如下:IP:192.1.1.221队列管理器:admin1def ql (local1) replacedef ql (tr1) usage (xmitq) defpsist (yes)def qr (remote1) rqmname(admin2) rname (local2) xmitq (tr1) replacedef chl (admin1toadmin2) chltype (sdr) trptype (tcp) xmitq (tr1) ...显示全部
我重装系统后的新配置如下:
IP:192.1.1.221
队列管理器:admin1
def ql (local1) replace
def ql (tr1) usage (xmitq) defpsist (yes)
def qr (remote1) rqmname(admin2) rname (local2) xmitq (tr1) replace
def chl (admin1toadmin2) chltype (sdr) trptype (tcp) xmitq (tr1) conname ('192.1.1.222(1414)') replace
start chl (admin1toadmin2)
def chl (admin2toadmin1) chltype (rcvr) replace
def listener (ls1) trptype (tcp) port (1414) control (qmgr)
start listener (ls1)
def ql (dead1) replace
alter qmgr deadq (dead1)

IP:192.1.1.222
队列管理器:admin2
def ql (local2) replace
def ql (tr2) usage (xmitq) defpsist (yes)
def qr (remote2) rqmname(admin1) rname (local1) xmitq (tr2) replace
def chl (admin2toadmin1) chltype (sdr) trptype (tcp) xmitq (tr2) conname ('192.1.1.221(1414)') replace
start chl (admin2toadmin1)
def chl (admin1toadmin2) chltype (rcvr) replace
def listener (ls2) trptype (tcp) port (1414) control (qmgr)
start listener (ls2)
def ql (dead2) replace
alter qmgr deadq (dead2)

发送过程:
/opt/mqm/samp/bin/./amqsput REMOTE1
FDFDF
FDFDF
接收过程:
/opt/mqm/samp/bin/./amqsget LOCAL2
稍等一会儿显示如下:
Sample AMQSGET0 start
no more messages
Sample AMQSGET0 end
这是什么问题
看发送方的传输队列及死信队列并没有消息,查看接收方的本地队列及死信队列也一样没有消息,消息跑哪里去了呢???????
当我发送一条消息后错误日志如下:
09/24/2011 06:26:58 PM - Process(3202.4) User(mqm) Program(amqrmppa)
AMQ9565: No dead-letter queue defined.

EXPLANATION:
The queue manager 'admin2' does not have a defined dead-letter queue.
ACTION:
Either correct the problem that caused the program to try and write a message
to the dead-letter queue or create a dead-letter queue for the queue manager.
----- amqrmmqa.c : 360 --------------------------------------------------------
09/24/2011 06:26:58 PM - Process(3202.4) User(mqm) Program(amqrmppa)
AMQ9599: Program could not open queue manager object.

EXPLANATION:
The attempt to open either the queue or queue manager object 'LOCAL2' on queue
manager 'ADMIN2' by user '' failed with reason code 2087.
ACTION:
Ensure that the queue is available and retry the operation. If the message is
from a remote Queue Manager, check the Message Channel Agent User Identifier
has the correct authority.收起
互联网服务 · 2011-09-24
浏览1304
zhangchao_32zhangchao_32软件开发工程师aaa
这可能是我的笔误,实际上我并未搞弄。我正重装试试,太折腾人了。显示全部
这可能是我的笔误,实际上我并未搞弄。我正重装试试,太折腾人了。收起
互联网服务 · 2011-09-22
浏览1221
sangmin214sangmin214系统工程师SS
你在admin1服务器上说admin2上的那个队列叫local2,但是实际上,admin2上的那个queue叫loca2。你把队列的名字搞错了显示全部
你在admin1服务器上说admin2上的那个队列叫local2,但是实际上,admin2上的那个queue叫loca2。
你把队列的名字搞错了收起
系统集成 · 2011-09-22
浏览1196
zhangchao_32zhangchao_32软件开发工程师aaa
关于“define qr (remote1) rname (local2) rqmname (admin2) xmitq (tr1) replaceVS本地队列:loca2”你的意思是我需要在接收方也要定义一下远程队列remote1吗?显示全部
关于“define qr (remote1) rname (local2) rqmname (admin2) xmitq (tr1) replace
VS
本地队列:loca2”
你的意思是我需要在接收方也要定义一下远程队列remote1吗?收起
互联网服务 · 2011-09-22
浏览1210

提问者

zhangchao_32
软件开发工程师aaa

问题状态

  • 发布时间:2011-09-20
  • 关注会员:1 人
  • 问题浏览:14807
  • 最近回答:2011-10-20
  • X社区推广