我需要將WebSphere MQ7隊列(稱爲隊列管理器QMA中的queA)映射到EJB3 MDB。如何將websphere mq 7隊列映射到EJB 3 destinationName
我創建的MQ隊列管理器,並使用
crtmqm QMA
並啓動隊列使用strmqm MQA
然後我寫了一個文件的文件名QMA.conf
,其中包括
DEFINE QLOCAL ('queA')
線並運行該命令
runmqsc QMA < QMA.conf
然後我跑
strmqcsv MQA &
runmqlsr -m QMA -t TCP &
所有這些步驟都以mqm登錄的用戶身份完成。
然後我按照 http://community.jboss.org/wiki/JBossEAP5IntegrationwithWebSphereMQ 鏈接並配置RAR到jboss 5.1。當我運行也成功的測試連接。
在那裏,我有
* channel - SYSTEM.DEF.SVRCONN
* hostName - localhost
* port - 1414
* queueManager - ExampleQM
* transportType - CLIENT
,並在我的MDB我包括
@MessageDriven(name="WMQMDBTest",
activationConfig =
{
@ActivationConfigProperty(propertyName="messagingType",propertyValue="javax.jms.MessageListener"),
@ActivationConfigProperty(propertyName = "destinationType",propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "queA"),
@ActivationConfigProperty(propertyName = "useJNDI", propertyValue = "true"),
@ActivationConfigProperty(propertyName = "channel", propertyValue = "SYSTEM.DEF.SVRCONN"),
@ActivationConfigProperty(propertyName = "hostName", propertyValue = "localhost"),
@ActivationConfigProperty(propertyName = "queueManager", propertyValue = "QMA"),
@ActivationConfigProperty(propertyName = "port", propertyValue = "1414"),
@ActivationConfigProperty(propertyName = "transportType", propertyValue = "CLIENT"),
@ActivationConfigProperty(propertyName = "username", propertyValue = "mqm"),
@ActivationConfigProperty(propertyName = "password", propertyValue = "password")
})
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
@ResourceAdapter(value = "wmq.jmsra.rar")
當我嘗試部署豆它說
DEPLOYMENTS IN ERROR:
Deployment "jboss.j2ee:ear=integration-1.0-SNAPSHOT.ear,jar=business-logic-1.0-SNAPSHOT.jar,
name=WMQMDBTest,service=EJB3" is in error due to the following reason(s):
javax.naming.NameNotFoundException: queA not bound
是否已確認queA在QMA確實存在?我讀過你創建了一個腳本來定義它,但不是你通過在runmqsc中顯示它或通過在WMQ資源管理器中查看它來驗證它存在。 – 2011-06-09 21:19:12
是隊列在WQM中可用。 – Asanga 2011-06-10 13:10:38
好吧,那是一個開始。不幸的是,就我而言。我沒有看到WMQ的這部分內容會阻止你的連接,也不知道JBoss的配置。我會提供的一件事是,如果你已經安裝了完整的WMQ客戶端(而不是隻抓取jar文件),那麼你可以使用示例程序來驗證你的連接。如果您可以使用現有的WMQ配置使用amqsputc進行連接,那麼您已將問題縮小到JBoss配置。當然,如果你所做的只是抓住瓶子,那麼你對於可以執行什麼診斷極其有限。 – 2011-06-10 15:16:59