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 » General Discussion » how to delete message in the queue after i get it?

Post new topic  Reply to topic
 how to delete message in the queue after i get it? « View previous topic :: View next topic » 
Author Message
bigmq
PostPosted: Tue Jan 18, 2005 6:46 am    Post subject: how to delete message in the queue after i get it? Reply with quote

Novice

Joined: 14 Sep 2004
Posts: 19

When i use mqGet method, i thought the message should be deleted automatically, but it is not, why? and how I could delelte them after i get them?
Thanks a million
Back to top
View user's profile Send private message
bower5932
PostPosted: Tue Jan 18, 2005 6:53 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

If you 'get' the message, it is removed from the queue. My guess would be that you either browsed the message or got it inside of a unit of work and didn't commit.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
bigmq
PostPosted: Tue Jan 18, 2005 8:39 am    Post subject: Thank you bower Reply with quote

Novice

Joined: 14 Sep 2004
Posts: 19

I think i just use browse, but i did get message out and make a file, why?
and how i "really" get the message out of the queue, and delete them after i get, change some options? or what?
Many thanks
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jan 18, 2005 8:40 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Don't use "browse".

"browse" means "leave messages on the queue".
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
bigmq
PostPosted: Tue Jan 18, 2005 8:54 am    Post subject: Reply with quote

Novice

Joined: 14 Sep 2004
Posts: 19

Yes, sir, i do use get instead of browse:
myQueue.get(myMessage, gmo);

and these options are used:
MQGetMessageOptions gmo = new MQGetMessageOptions();
gmo.options = MQC.MQGMO_WAIT | MQC.MQGMO_BROWSE_FIRST;

Is there anything wrong?
Thanks
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jan 18, 2005 9:03 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

If your options say "BROWSE_FIRST", then how are you not using "browse"?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
zpat
PostPosted: Tue Jan 18, 2005 9:04 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

There is not a browse MQI call - there is only a MQGET call (to retrieve messages) with options.

You are asking for browse on your get options by the look of your code.

I recommend coding WAIT, CONVERT, FAIL_IF_QUEISCING on all MQGETs.
Back to top
View user's profile Send private message
bigmq
PostPosted: Tue Jan 18, 2005 9:46 am    Post subject: Reply with quote

Novice

Joined: 14 Sep 2004
Posts: 19

all right, i changed my options to
gmo.options = MQC.MQGMO_WAIT + MQC.MQGMO_CONVERT;

but now i found another problem: i only can get the last message out in the queue, other messages are still sitting inside the queue. What happened?
Thanks
Back to top
View user's profile Send private message
JT
PostPosted: Tue Jan 18, 2005 10:12 am    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

Messages are not retrieved from the queue en masse, but rather, one at a time.

You need to loop through your code, until you reach the condition 'MQRC_NO_MSG_AVAILABLE'.
Back to top
View user's profile Send private message
bower5932
PostPosted: Tue Jan 18, 2005 10:35 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

You might want to go look at some of the samples. There are ones here on this site. The product ships with some (amqsget comes to mind). There are also some at: http://www.developer.ibm.com/tech/sampmq.html
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
kirani
PostPosted: Tue Jan 18, 2005 11:24 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Oh .. and don't forget the MQ documentation. Take a look at chapter 10 in Application Programming Guide.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » how to delete message in the queue after i get it?
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.