Author |
Message
|
bigmq |
Posted: Tue Jan 18, 2005 6:46 am Post subject: how to delete message in the queue after i get it? |
|
|
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 |
|
 |
bower5932 |
Posted: Tue Jan 18, 2005 6:53 am Post subject: |
|
|
 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 |
|
 |
bigmq |
Posted: Tue Jan 18, 2005 8:39 am Post subject: Thank you bower |
|
|
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 |
|
 |
jefflowrey |
Posted: Tue Jan 18, 2005 8:40 am Post subject: |
|
|
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 |
|
 |
bigmq |
Posted: Tue Jan 18, 2005 8:54 am Post subject: |
|
|
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 |
|
 |
jefflowrey |
Posted: Tue Jan 18, 2005 9:03 am Post subject: |
|
|
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 |
|
 |
zpat |
Posted: Tue Jan 18, 2005 9:04 am Post subject: |
|
|
 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 |
|
 |
bigmq |
Posted: Tue Jan 18, 2005 9:46 am Post subject: |
|
|
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 |
|
 |
JT |
Posted: Tue Jan 18, 2005 10:12 am Post subject: |
|
|
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 |
|
 |
bower5932 |
Posted: Tue Jan 18, 2005 10:35 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
|
Back to top |
|
 |
kirani |
Posted: Tue Jan 18, 2005 11:24 pm Post subject: |
|
|
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 |
|
 |
|