ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » Get call is failing

Post new topic  Reply to topic
 Get call is failing « View previous topic :: View next topic » 
Author Message
merlin
PostPosted: Wed Jun 16, 2004 7:48 am    Post subject: Get call is failing Reply with quote

Novice

Joined: 07 Mar 2004
Posts: 19

Hi,

Hope that someone has come across this scenario and can guide me in the right direction...
Have got a java app talking to MQ, which, so far, has had no problems sending messages to the queue and getting messages from another queue.
Have extended the code now whereby when a message is sent (to a clustered queue as it happens) the app at that end fires back a message to my local queue called "REPLYTOQUEUE" (imaginative, huh?)
The problem I am getting is that the app this end is able to find the correct message amongst those sat on this REPLYTOQUEUE queue as I am using Message and Correlation Ids to check for the right one. However, when I make the 'get' call, although it finds the one required and no exception is thrown, the message remains on the queue after the app has stopped running. What I want is for it to behave 'normally' and consume the message from my REPLYTOQUEUE queue.
Here is the relevant section of java code:

//create new MQMessage obj to receive in reply
MQMessage replyMessage = new MQMessage();
MQGetMessageOptions gmo = new MQGetMessageOptions();
gmo.matchOptions = MQC.MQMO_MATCH_CORREL_ID;
gmo.options = MQC.MQGMO_WAIT;
gmo.waitInterval = waitFor;
replyMessage.correlationId = correlId;
QRunnerLogger.getLogger().info("About to try to get reply message, depth is "+replyQ.getCurrentDepth());
replyQ.get(replyMessage,gmo);
long end = System.currentTimeMillis();
QRunnerLogger.getLogger().info("Got suitable Reply message in "+(end-start)+" ms");

The correlId value has been passed from the value I got earlier in the code when sending out a message. As stated, this works fine apart from not consuming the messages on the in-queue.

Please help...!
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Jun 16, 2004 7:57 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Are you in some sort of transaction? Are you committing the transaction?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
merlin
PostPosted: Wed Jun 16, 2004 8:43 am    Post subject: Reply with quote

Novice

Joined: 07 Mar 2004
Posts: 19

hi Jeff, thanks for your reply.
No, this does not form part of a transaction and I have no 'commits' in the code.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Get call is failing
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.