關鍵詞: PSIVTRun MQQueueManager
一般的進行nojndi 驗證全能成功,下面進行jndi 方式的驗證:
要先建jndi , 供PSIVTRun 默認使用.
cd /opt/mqm/java/bin
./JMSAdmin
DEFINE TCF(ivtTCF)
--This command defines the TopicConnectionFactory.
DEFINE T(ivtT) TOPIC(MQJMS/PSIVT/Information)
--This command defines the Topic.
執(zhí)行命令:
./PSIVTRun -url "file:/JNDI-Directory" -icf com.sun.jndi.fscontext.RefFSContextFactory
即可.
[djboss@DevStation1 bin]$ ./PSIVTRun -url "file:/JNDI-Directory" -icf com.sun.jndi.fscontext.RefFSContextFactory
5724-H72, 5655-L82, 5724-L26 (c) Copyright IBM Corp. 2002, 2005. All Rights Reserved.
用于 Java(tm) 消息服務的 Websphere MQ 類 6.0
發(fā)布/預訂安裝驗證測試
正在使用受管對象,請確保它們可用
正在檢索來自 JNDI 的 TopicConnectionFactory
正在檢索來自 JNDI 的 Topic
正在創(chuàng)建 Connection
正在創(chuàng)建 Session
正在創(chuàng)建 TopicPublisher
正在創(chuàng)建 TopicSubscriber
正在創(chuàng)建 TextMessage
正在添加文本
正在將消息發(fā)布至 topic://MQJMS/PSIVT/Information
正在等待消息抵達[最大為 5 秒]...
取出消息:
JMS 消息類: jms_text
JMSType: null
JMSDeliveryMode: 2
JMSExpiration: 0
JMSPriority: 4
JMSMessageID: ID:414d5120706172656e74323020202020060ee147c5da0020
JMSTimestamp: 1206523343329
JMSCorrelationID:ID:414d5120706172656e74323020202020060ee14705680320
JMSDestination: topic://MQJMS/PSIVT/Information
JMSReplyTo: null
JMSRedelivered: false
JMS_IBM_PutDate:20080326
JMSXAppID:parent20
JMS_IBM_Format:MQSTR
JMS_IBM_PutApplType:26
JMS_IBM_MsgType:8
JMSXUserID:djboss
JMS_IBM_PutTime:09222333
JMSXDeliveryCount:1
A simple text message from the MQJMSPSIVT program
應答字符串等于原始字符串
正在關閉 TopicSubscriber
正在關閉 TopicPublisher
正在關閉 Session
正在關閉 Connection
PSIVT 已完成
[djboss@DevStation1 bin]$
若遇到如下錯誤,是由于默認隊列管理器沒有建立.
[tjboss@TestStation30 bin]$ ./PSIVTRun -url "file:/JNDI-Directory" -icf com.sun.jndi.fscontext.RefFSContextFactory
5724-H72, 5655-L82, 5724-L26 (c) Copyright IBM Corp. 2002, 2005. All Rights Reserved.
用于 Java(tm) 消息服務的 Websphere MQ 類 6.0
發(fā)布/預訂安裝驗證測試
正在使用受管對象,請確保它們可用
正在檢索來自 JNDI 的 TopicConnectionFactory
正在檢索來自 JNDI 的 Topic
正在創(chuàng)建 Connection
捕獲到異常: javax.jms.JMSException: MQJMS2005: 未能為 '' 創(chuàng)建 MQQueueManager
鏈接的異常: com.ibm.mq.MQException: MQJE001: 完成代碼是 2,原因為 2059
PSIVT 已完成
winXP 上用圖形的隊列管理器工具就可以了.

修改屬性圖:
若為lunix 環(huán)境:
修改在mqm 用戶的當前目錄有文件mqs.ini
直接修改加入
DefaultQueueManager:
Name=parent20
也可用命令產(chǎn)生:
>crtmqm -q testQM
這條語句將產(chǎn)生
DefaultQueueManager:
Name=testQM
改成你想要的結果即可.
參考資料:
The publish/subscribe installation verification test
MQJMS5062 2085 PSIVTRun with JNDI failed
方向:分布式系統(tǒng)設計