Author |
Message
|
kush911 |
Posted: Mon Jan 08, 2007 8:31 am Post subject: Deleting particular message from q |
|
|
Novice
Joined: 17 Aug 2006 Posts: 11
|
Hi,
I have a requriement that i hav to browse the MQ and reach to the message which i have to delete and then delete the message leaving al the other messages intact.
I opened the MQ in Browse as well as deletion mode
then i browsed the MQ to reach the problematic record and then whn the reocrd was found i used the Get message properties to delte the roeds but the actual record that was deleted was the record at the top of the MQ.
it seems it initializes the counter whn the GET message properties are changed.
please suggest... |
|
Back to top |
|
 |
Vitor |
Posted: Mon Jan 08, 2007 8:35 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
How did you access the queue? Most utilities only issue a BROWSE_FIRST so you always get the first message.
If you have an ongoing requirement for this you need to write some code to do BROWSE_FIRST / BROWSE_NEXT until it locates the correct message. For an intermittant requirement look into the MO71 support pack. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
kush911 |
Posted: Mon Jan 08, 2007 8:38 am Post subject: |
|
|
Novice
Joined: 17 Aug 2006 Posts: 11
|
i did a BROWSE NEXT to reach to the appropriate message .. as the BROWSE does not delete the message from the QUerue .. then i did a destructive MQGET which instead of deleting this message deleted the first message from the queue.. |
|
Back to top |
|
 |
pathipati |
Posted: Mon Jan 08, 2007 8:40 am Post subject: |
|
|
Master
Joined: 03 Mar 2006 Posts: 296
|
do you have the messageId?
If you've 10 messages and if you want to delete 5th message u can try support pac MA01 |
|
Back to top |
|
 |
Vitor |
Posted: Mon Jan 08, 2007 8:42 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
kush911 wrote: |
i did a BROWSE NEXT to reach to the appropriate message .. as the BROWSE does not delete the message from the QUerue .. then i did a destructive MQGET which instead of deleting this message deleted the first message from the queue.. |
MQGET always gets the first message from the queue. Use GET_MSG_UNDER_CURSOR. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
kush911 |
Posted: Wed Jan 10, 2007 8:35 am Post subject: |
|
|
Novice
Joined: 17 Aug 2006 Posts: 11
|
i tried the browse-msg-under-cursor option ... but i cannot use it with SYNCPOINT option and the messages still remain on the queue - i.e. its not getting desturctively read. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jan 10, 2007 8:40 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
kush911 wrote: |
i tried the browse-msg-under-cursor option ... but i cannot use it with SYNCPOINT option and the messages still remain on the queue - i.e. its not getting desturctively read. |
Well no, if you browse the message under the cursor it's not going to be destructively read is it? Why not use the destructive reading version, i.e. without BROWSE????  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
kush911 |
Posted: Wed Jan 10, 2007 8:44 am Post subject: |
|
|
Novice
Joined: 17 Aug 2006 Posts: 11
|
but using without browse it deletes the first message from the MQ instead of the 5th message it has to delete.
If i provide browse-msg-under-cursor i am able to catch the cursor at which the record is .... but whn i dont give this option it seems the cursor position gets initialized for destructive read and it deletes the first record |
|
Back to top |
|
 |
KevinF23492 |
Posted: Wed Jan 10, 2007 5:34 pm Post subject: |
|
|
Novice
Joined: 26 Dec 2006 Posts: 22
|
Have you ever thought about reading the Application Programming Guide?
In Chapter 10 : "Getting Messages from a Queue"
There is a section called "Getting a Particular message"...might be worth a read I would think
Closely followed by "Browsing Messages on a Queue: which spookily enough has a little sub topic titled "Removing a message you have browsed"
Sort of may help you a little  |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jan 11, 2007 12:03 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
kush911 wrote: |
If i provide browse-msg-under-cursor i am able to catch the cursor at which the record is .... but whn i dont give this option it seems the cursor position gets initialized for destructive read and it deletes the first record |
So you are seriously telling me that when you use the option "browse msg under cursor" you get the 5th record, but using the option "msg under cursor" it removes the 1st record??
IF this is what you're saying, double check your code using the reference KevinF23492 has kindly provided. If your code appears correct (i.e. you're not just doing a get when you reach the right record) and the behaviour is repeatable, then you need to contact IBM to raise a PMR.
Or look for the other bug in your code because this works!  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
kush911 |
Posted: Thu Jan 11, 2007 7:52 am Post subject: |
|
|
Novice
Joined: 17 Aug 2006 Posts: 11
|
i am getting 5th record with "Browse" and also with "Msg_under_cursor" but the problem is the message is not geeting deleted from the queue. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jan 11, 2007 8:07 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
kush911 wrote: |
i am getting 5th record with "Browse" and also with "Msg_under_cursor" but the problem is the message is not geeting deleted from the queue. |
Well, if you're totally certain that your code matchs the requirements laid out in the manual (specifically that you're using the destructive version of msg_under_cursor) and you've no syncpoint or other code issues preventing the removal of the message then you should raise a PMR. This is the only option when the code is correct and the product does not do what it's documented to do.
It's a shame because I've used this method on many occassions and it works, as (I suspect) have many other people and some of the support packs! I can only theorse that it's a bizzare combination of the CSD level of the product on the particular platform that you're using.
Having eliminated the most likely problem that's all that's left. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
tleichen |
Posted: Thu Jan 11, 2007 8:37 am Post subject: |
|
|
Yatiri
Joined: 11 Apr 2005 Posts: 663 Location: Center of the USA
|
If you're opening the queue with MQOO_BROWSE and you are specifying MQGMO_BROWSE_MSG_UNDER_CURSOR, then the message will not be deleted from the queue.  _________________ IBM Certified MQSeries Specialist
IBM Certified MQSeries Developer |
|
Back to top |
|
 |
kush911 |
Posted: Fri Feb 23, 2007 5:35 am Post subject: |
|
|
Novice
Joined: 17 Aug 2006 Posts: 11
|
tnx to all of you for your valueable responses |
|
Back to top |
|
 |
santosh.lokhande |
Posted: Sun Mar 04, 2007 11:19 pm Post subject: How do we delete msg's once read. |
|
|
Newbie
Joined: 03 Mar 2007 Posts: 6 Location: NA
|
I have a similiar doubt.
I am quite new to MQ and for a proj requirement
I am reading the MQ. The problem is I am facing problem
when I read the message and as soon as its read Ive to delete it off.
Pls suggest.
The options I am using are
openOptions = MQC.MQOO_INPUT_AS_Q_DEF |MQC.MQOO_OUTPUT| MQC.MQOO_BROWSE
gmo.options = MQC.MQGMO_BROWSE_NEXT | MQC.MQGMO_WAIT
I am using the clearMessage() method on the Message object.
It still is failing to remove the message. _________________ Regards
Santosh |
|
Back to top |
|
 |
|