开发者

Trouble synchronously receiving messages from Queue in Websphere 6.1

开发者 https://www.devze.com 2023-03-21 22:06 出处:网络
I have trouble developing JMS application with Websphe开发者_开发百科re 6.1.0.33 with EJB 3.0 FP.

I have trouble developing JMS application with Websphe开发者_开发百科re 6.1.0.33 with EJB 3.0 FP.

Application has two queues - RequestQueue and ResponseQueue. An MDB is attached to RequestQueue to process messages via Session bean and to post responses in ResponseQueue. Servlet is used as a testing client. It has two options - to send a request to RequestQueue and to synchronously receive response via MessageConsumer.receiveNoWait. The problem is that receiveNoWait always return null - even if there are messages is queue (i can see 'em through AdminConsole). MessageConsumer.receive blocks forever. Moreover, if I attach MDB to listen to ResponseQueue, it will work ok and receive all the responses.

SIB is used as the messaging engine, there are two destinations linked to queues. For each MDB there is an Activation Specification configured.

I double-checked all bindings and still can't see the problem.

Specifying trace as in http://www-01.ibm.com/support/docview.wss?uid=swg21199176 gives no useful data.

Maybe I left out some configuration component?


It's a bit hard to understand your exact setup based on your description, but if I understand correctly your servlet is connecting to the ResponseQueue explicitly (creating a MessageConsumer based on a "normal" JMS connection rather than a JCA/activation profile binding). This would be a problem if you also have an activation profile configured for the ResponseQueue as the activation profile would "take over" consumption of the queue. Make sure that you remove any activation profile for ResponseQueue if you intend to consume it manually.


Case solved!

Missed connection.start() call.

Thanks @pap for your help =).

Should pay more attention to docs next time.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号