File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes MQ messages stuck forever Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "MQ messages stuck forever" Watch "MQ messages stuck forever" New topic

MQ messages stuck forever

Karan Jain
Ranch Hand

Joined: May 30, 2007
Posts: 82

I am working on enhancement of an old J2EE application which communicates with Mainframes using MQ.
After sending the data to MQ request Queue it waits for the reply on the response queue. The wait period is 2 mins.
After that it shows an popup to user that there is problem processing your request, but on the mainframes side the request was processed and data is updated in their database. So our database is out of sync and also the message is stuck in the queue forever.

How can I enhance it so that our database is updated properly?

Any suggestions are appreciated.

Thanks in advance,

Greg Charles

Joined: Oct 01, 2001
Posts: 2968

OK, if I'm understanding this correctly the J2EE sending a message to a mainframe application, and expecting the mainframe to send a second (response) message back to it. That message never arrives, and yet the mainframe has received the request message and processed it successfully. It seems unlikely to me that the response message is "stuck" in the queue. Much more likely is that the mainframe app just isn't sending one. Is that possible?
Karan Jain
Ranch Hand

Joined: May 30, 2007
Posts: 82
Thanks for the response.

The scenario is like this:

1. J2EE app send a message on request Q for Mainframe app and wait for the response on the response Q for 2 mins.
2. When mainframe app completes the message processing it writes the response on the response Q.
3. But if Mainframe app takes more than 2 mins to write the message on the response, the J2EE app timesout and shows a popup error on the screen to the user.
4. Now if the mainframe writes the message on the response Q, it get stuck for ever.

Is there any good way to handle this scenario.

Thanks in advance.
teoh ks

Joined: Dec 04, 2011
Posts: 1
Dear all,

I am having the same kind of problem, there are times where the response from our backend host sending to our web got stuck in the queue(due to unknown reasons) and when the communication is back into normal the stucked message will be sent to the web and the subsequent request (not the previous request) is getting the stucked response which is meant for the previous request.

please help.

I agree. Here's the link:
subject: MQ messages stuck forever
jQuery in Action, 3rd edition