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 API Support » mqmessages are not removed from queue and queue is filling u

Post new topic  Reply to topic
 mqmessages are not removed from queue and queue is filling u « View previous topic :: View next topic » 
Author Message
wgoldman
PostPosted: Thu Sep 30, 2004 11:52 am    Post subject: mqmessages are not removed from queue and queue is filling u Reply with quote

Newbie

Joined: 30 Sep 2004
Posts: 4

I use the following code (running on a resin server, using com.ibm.mq api's) to retrieve a message from the queue;

MQQueue replyQueue = manager.accessQueue("MY.REPLY.QUEUE",MQC.MQOO_INPUT_AS_Q_DEF,"MYMQMANAGERNAME",null,null);
MQMessage replyMsg = new MQMessage();
replyMsg.correlationId = aCorrelationId;
MQGetMessageOptions gmo = new MQGetMessageOptions();
gmo.matchOptions = ( MQC.MQMO_MATCH_MSG_ID | MQC.MQMO_MATCH_CORREL_ID );
gmo.options = MQC.MQGMO_WAIT;
gmo.waitInterval = 60000;
replyQueue.get(replyMsg, gmo, 4096);
String reply = replyMsg.readString(4096);

How can I programmatically remove this message from the queue?
Back to top
View user's profile Send private message
vennela
PostPosted: Thu Sep 30, 2004 11:54 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

Is there any reason you are using this
Code:
gmo.matchOptions = ( MQC.MQMO_MATCH_MSG_ID | MQC.MQMO_MATCH_CORREL_ID );


If not comment this out and your messages will be gone
Back to top
View user's profile Send private message Send e-mail Visit poster's website
wgoldman
PostPosted: Thu Sep 30, 2004 11:57 am    Post subject: Reply with quote

Newbie

Joined: 30 Sep 2004
Posts: 4

Yes it is to locate a specific message on the queue using the correlation id. This code was inherited and I have slightly better than entry level mq experience. So if there are other settings that allow the selection of a specific message and removal (once it has been read), I am all ears.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Sep 30, 2004 12:00 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

If the message is READ ,that is if you get a successful return code from your get, then the message is REMOVED from the queue.

Unless the options have been set to browse the queue, which your code has not done. Or if your code is running in a transaction, then the message will not be REMOVED from the queue until the transaction is committed. But again, your code isn't doing this.

So if your code is not getting the message, then it is because the Message ID or Correlation ID are not matching.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
wgoldman
PostPosted: Thu Sep 30, 2004 12:03 pm    Post subject: Reply with quote

Newbie

Joined: 30 Sep 2004
Posts: 4

My code is getting and reading the message, it is just not being removed from the queue.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Sep 30, 2004 12:09 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

wgoldman wrote:
My code is getting and reading the message, it is just not being removed from the queue.


How do you know?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
wgoldman
PostPosted: Thu Sep 30, 2004 12:42 pm    Post subject: Reply with quote

Newbie

Joined: 30 Sep 2004
Posts: 4

Actually this correspondence got the wheels turning and I realized that the reason the messages were not being removed was because the production system was receiving 'time outs' attempting to read the message, so in fact the application was NOT reading the message successfully.

The reason the app was receiving a time out is another discussion, but the jist of it is the secondary application responsible for posting the message is too slow in doing so.

Thank you for your help!
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 API Support » mqmessages are not removed from queue and queue is filling u
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.