I am using EJB 3 MDB, websphere MQ V5.3and RAD V8 combination,have defined activation specification.I am sending one message in request MQ(REQUEST_QUEUE) then it is heating DB get some data and putting this response in another queue (RESPONSE_QUEUE),i am trying to read this RESPONCE_QUEUE through java code but getting time out exception as below.Code of send and receive is also attached below.Please advice.
Is this version related issue of web sphere MQ (As I am using MQ-V5.3)? OR Am I missing some code in java? OR Any setting in RAD8 server required?
0000001e TimeoutManage I WTRN0006W: Transaction 000001368307B819000000060C169F2488E5D793A026BBCB5982901AB3984096B231C220000001368307B819000000060C169F2488E5D793A026BBCB5982901AB3984096B231C22000000001 has timed out after 120 seconds.
4/5/12 20:35:02:968 IST 0000001e TimeoutManage I WTRN0124I: When the timeout occurred the thread with which the transaction is, or was most recently, associated was ThreadWebContainer : 0,5,main. The stack trace of this thread when the timeout occurred was:
According to the JavaDoc, QueueReciever.receive() is a blocking call and there is no mention of a time out in the API. Even the one that takes a timeout duration (receive (long timeoutMillis) ) doesn't throw an exception. I do see the socket being opened for reading something. Does this occur for every message that is being produced? Can you see on the MQ side what's going on? Did the message come in to the JMS provider? Was the message completely lost or is it still on the queue when this exception occurred? (I'd say it's the latter, since it aborted without acknowledging the message).
Can you write a simple stand-alone java class which produces and consumes from the same MQ without any errors?
Googling doesn't make you a genius. But not Googling makes you dumber.
Joined: Apr 19, 2012
I have tried with (receive (long timeoutMillis) ) by giving 50 sec timeout,though my query in MDB is taking only 15 sec to generate response but after increasing time out also no success,even I tried with Thread.sleep,but no way.And yes this is occurring for every message that we put on MQ. On MQ side yes we can see message which is present in request queue.Message was not lost when exception occurs. Also,we tried to send and receive message by creating sample project but getting same error. Don't know what is the issue?
Background: We are migrating from WAS 5.0 to WAS 8 and EJB 2.0 to EJB 3.0.
We are also using Websphere MQ series for sending and receiving messages asynchronously. We have a specific search functionality in our application which works as below:
1. Click on search button ->
2. It calls struts 1.1 action class ->
3. It calls a stateless session bean - DocumentSearchManagerBean (Migrated to 3.0) -> then it prepares an request xml and calls a method named sendReceive(), this method first calls send() method which sends the message by putting request xml on MQ "REQUEST" queue then there is an MDB for which we defined activation specification and code in this MDB is called up whenever message appears on "REQUEST" queue. MDB calls another session bean there by DAO layer class to hit DB and generate response xml. This response xml is put on a MQ "RESPONSE" queue.
In order to listen to response xml there is a receive method written in DocumentSearchManagerBean which listens to "RESPONSE" queue and gets the response XML and parses that xml and throws out put to UI layer.
Things are working fine when we use EJB 2.0 with migrated WAS 8.0 code.
But when we work with EJB 3.0, it does not seems to be working. here MDB itself is not getting hit.
But as soon as we comment out receive method's code then MDB is getting hit.
Also whenever we manually put the message on MQ "REQUEST" queue then MDB is getting hit.
This is what I have understood so far: you have two queues. You try to put a message to your 'Request' queue. You have an MDB listening on the queue. And the MDB is not getting the message. If it gets the message, it will query the DB and create another message to be put on the 'Response' queue.
What I don't understand is why would you have this code:
And where exactly does the MDB figure in this design?
Joined: Apr 19, 2012
We have tried today to send message to MQ through servlet and we are receiving message in the same servlet by QueueReceiver.receive() .We are succeeded in sending and receiving message in MQ by using servlet. Bu the same thing when we are trying by using session bean then it is hanging out for some time and getting time out exception.
As our session bean sends message in request queue then MDB heats,in this case is there any binding needed between session bean and MDB?
Asking because when servlet sends message in request queue then MDB heats successfully and QueueReceiver.receive() method in servlet got responce message in MQ.