• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Websphere 6.1 JMS - Strange receiveNoWait() behaviour?

Michael Wyatt
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone, a bit of a newb here with some JMS weirdness. I'm dealing with a problem at a customer's site where a small number ( <1%) of JMS host calls are failing. It's deployed on Websphere 6.1 on an AIX platform, using MQ as the message transport layer. This code is part of a host system interface - my servlet code sends an MQ request through the JMS API, does whatever other processing it can, then waits for the JMS response (with a 10 second timeout). The thread uses a Message Selector based on the CorrelationID, and calls receiveNoWait() in a loop with a Thread.sleep() time of 50ms. Several times a day the response message will be delivered to my queue, but receiveNoWait() will continue to return null. It doesn't appear to be related to load or time of day.

I've put together a little JSP page to test things and try to understand if it's some kind of problem related to the order of messages on the queue, the size of the queue, etc. So far I've drawn a blank, except for one consistent error: If I manually set the Correlation ID to 2 then I can't read the message back from the queue using receiveNoWait(). receive() works fine, it's just receiveNoWait(), and only with a Correlation ID of 2 (that I've found). I've put my test JSP page at the end of this post, the interesting difference between the two messages is:

This code picks up the message:

This code does not:

This is an interesting weirdness, and could be related, or could be a red herring. I've tried hard-coding real correlation IDs that failed in production, however they work fine here (on my windows XP box, using the Websphere SIB rather than MQ).

So, has anyone ever had any problems with the Websphere implementation of JMS, particularly with receiveNoWait()? Has anyone ever seen occasional JMS messages sitting on a queue that for one reason or another their application just can't read? Is there a simple mistake in here that I've overlooked?

I'm clutching at straws a bit on this one, so any advice or knowledge would be much appreciated!

Thanks in advance,

Mike W

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic