IBM MQ - Java api - PCFMessageAgent - 连接失败

IBM MQ - Java api - PCFMessageAgent - connection fails

我用我自己的服务器连接通道更改了 MQ 中的 MQIVP 示例 local.server.con,它工作正常。但是我尝试使用 PCFMessageAgent 连接到同一通道,但连接失败并在 MQ 日志中出现错误。我的频道与 SYSTEM.DEFAULT.MODEL.QUEUE 之间的关系是什么,它给出了错误。

C:\Program Files\IBM\WebSphere MQ\Tools\wmqjava\samples>java -Djava.library.path="C:\Program Files\IBM\WebSphere MQ\java\lib" MQIVPMod
Websphere MQ for Java Installation Verification Program
5724-B4 (C) Copyright IBM Corp. 2002, 2014. All Rights Reserved.
================================================================

Please enter the IP address of the MQ server                  :10.40.1.16
Please enter the port to connect to                           : (1414)1415
Please enter the server connection channel name               :local.server.con
Please enter the user name (or RETURN for none)               :test
Please enter the password for the user                        :test123
Please enter the queue manager name                           :local
Success: Connected to queue manager.
Success: Opened SYSTEM.DEFAULT.LOCAL.QUEUE
Success: Put a message to SYSTEM.DEFAULT.LOCAL.QUEUE
Success: Got a message from SYSTEM.DEFAULT.LOCAL.QUEUE
Success: Closed SYSTEM.DEFAULT.LOCAL.QUEUE
Success: Disconnected from queue manager


Tests complete -
SUCCESS: This MQ Transport is functioning correctly.
Press Enter to continue ...

我的 PCFMessageAgent 代码和错误:

new PCFMessageAgent(host, Integer.parseInt(port), channelName); // connect

com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2035'.
    at com.ibm.mq.MQDestination.open(MQDestination.java:323)
    at com.ibm.mq.MQQueue.<init>(MQQueue.java:236)
    at com.ibm.mq.MQQueueManager.accessQueue(MQQueueManager.java:2674)
    at com.ibm.mq.pcf.PCFAgent.open(PCFAgent.java:448)
    at com.ibm.mq.pcf.PCFAgent.open(PCFAgent.java:394)
    at com.ibm.mq.pcf.PCFAgent.connect(PCFAgent.java:287)
    at com.ibm.mq.pcf.PCFAgent.<init>(PCFAgent.java:190)
    at com.ibm.mq.pcf.PCFMessageAgent.<init>(PCFMessageAgent.java:157)
    at test.wmq.PCFTest.main(PCFTest.java:49)

以及 MQ 日志:

5/2/2017 14:01:31 - Process(6048.60) User(MUSR_MQADMIN) Program(amqzlaa0.exe)
                      Host(BLR_SWG_N09505) Installation(Installation1)
                      VRMF(8.0.0.4) QMgr(local)

AMQ8077: Entity 'test@blr_swg_n09505' has insufficient authority to access
object 'SYSTEM.DEFAULT.MODEL.QUEUE'.

EXPLANATION:
The specified entity is not authorized to access the required object. The
following requested permissions are unauthorized: get
ACTION:
Ensure that the correct level of authority has been set for this entity against
the required object, or ensure that the entity is a member of a privileged
group. 
----- amqzfubn.c : 518 --------------------------------------------------------
5/2/2017 14:01:32 - Process(8004.41) User(MUSR_MQADMIN) Program(amqrmppa.exe)
                      Host(BLR_SWG_N09505) Installation(Installation1)
                      VRMF(8.0.0.4) QMgr(local)

AMQ9208: Error on receive from host BLR_SWG_N09505 (10.40.1.16).

EXPLANATION:
An error occurred receiving data from BLR_SWG_N09505 (10.40.1.16) over TCP/IP.
This may be due to a communications failure.
ACTION:
The return code from the TCP/IP recv() call was 10054 (X'2746'). Record these
values and tell the systems administrator. 
----- amqccita.c : 4076 -------------------------------------------------------
5/2/2017 14:01:32 - Process(8004.41) User(MUSR_MQADMIN) Program(amqrmppa.exe)
                      Host(BLR_SWG_N09505) Installation(Installation1)
                      VRMF(8.0.0.4) QMgr(local)

AMQ9999: Channel 'local.server.con' to host '10.40.1.16' ended abnormally.

EXPLANATION:
The channel program running under process ID 8004(7988) for channel
'local.server.con' ended abnormally. The host name is '10.40.1.16'; in some
cases the host name cannot be determined and so is shown as '????'.
ACTION:
Look at previous error messages for the channel program in the error logs to
determine the cause of the failure. Note that this message can be excluded
completely or suppressed by tuning the "ExcludeMessage" or "SuppressMessage"
attributes under the "QMErrorLog" stanza in qm.ini. Further information can be
found in the System Administration Guide. 
----- amqrmrsa.c : 930 --------------------------------------------------------

通道和模型队列之间没有关系。

但我认为,PCFMessageAgent 正在尝试创建一个动态队列以用作 ReplyToQ 来接收响应,而且它似乎试图通过打开 SYSTEM.DEFAULT.MODEL.QUEUE.

您需要阅读 MQ 权限(即授权)。最好对组做权限而不是原则(UserId)。

setmqaut -m {QM_NAME} -n SYSTEM.ADMIN.COMMAND.QUEUE -t queue -g {GROUP} +put +inq +dsp
setmqaut -m {QM_NAME} -n SYSTEM.DEFAULT.MODEL.QUEUE -t queue -g {GROUP} +get +inq +dsp