問題描述
Web Sphere + IMessageConsumer + 接收消息 (Web Sphere + IMessageConsumer + receiving messages)
I'd like to receive messages from a web sphere queue. So I create a session, than I create a IMessageConsumer and I call one of the methods: Receive or ReceiveNoWait. The problem is that I can't receive any messages. Receive simply waits and ReceiveNoWait returns null. I want to read messages that have already been added to the queue. Any help ?
參考解法
方法 1:
<p>@macpak: Are you sure you are connecting to right queue and/or u r connecting to correct queue manager? Are you sure that queue has some messages? IF you are using websphere MQ, using MQ explorer, you can view number of messages as well as number of open sessions. </p>
方法 2:
Have you started the connection? That's a classic reason for not getting messages in JMS
See
http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=/com.ibm.mq.xms.doc/concepts/xms_cconn_stastop.html