Author |
Message
|
VijayGoparaju` |
Posted: Mon Sep 15, 2008 2:19 am Post subject: Deleting a particular Message from the Queue |
|
|
Acolyte
Joined: 26 Aug 2008 Posts: 72
|
Hello All,
I am having a problem.I have to delete a particular message from the Queue. If I open the Queue in MQC.MQOO_INPUT_AS_Q_DEF using this mode, It will remove all the messages, If we open the Queue in MQC.MQOO_BROWSE Mode it will just Browse, But I want only a particular message to be deleted.So can I compare messageid with out browsing all the messages and directly going to that message by message id is it possible?
Please Help Me
Thanks & Regards,
Vijay....  |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Sep 15, 2008 2:41 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
It is so possible. It is also described in the programmer's manual  _________________ MQ & Broker admin |
|
Back to top |
|
 |
VijayGoparaju` |
Posted: Mon Sep 15, 2008 2:43 am Post subject: |
|
|
Acolyte
Joined: 26 Aug 2008 Posts: 72
|
How to go directly to that particular message? Please tell... |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Sep 15, 2008 2:46 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
fjb_saper wrote: |
It is so possible. It is also described in the programmer's manual  |
_________________ MQ & Broker admin |
|
Back to top |
|
 |
VijayGoparaju` |
Posted: Mon Sep 15, 2008 2:49 am Post subject: |
|
|
Acolyte
Joined: 26 Aug 2008 Posts: 72
|
But, I am having small doubt, If we open the queue in MQC.MQOO_INPUT_AS_Q_DEF mode all the messages will be removed from the queue then how we will delete a particular message? |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Sep 15, 2008 2:53 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
There is no substitute for reading and learning. Do you want us to program it for you as well? How much are you willing to pay us? Did you even check the documentation ? By the time elapsed between the posting the obvious answer is NO.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
VijayGoparaju` |
Posted: Mon Sep 15, 2008 2:59 am Post subject: |
|
|
Acolyte
Joined: 26 Aug 2008 Posts: 72
|
Sorry Saper,
I have already read the Documentation,But this Doubt I am not able to clear thats why,
Sorry once again,
Vijay... |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Sep 15, 2008 3:01 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Your posts show that if you have read the documentation you did not understand it. Read it again. Use a dictionary. Ask for it from IBM in your native language...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
bruce2359 |
Posted: Mon Sep 15, 2008 5:54 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
MQC.MQOO_INPUT_AS_Q_DEF tells mq that you want to open the queue for INPUT (not output) and the queue attribute value will determine if the open should be INPUT_SHARED or INPUT_EXCLUSIVE. Shared means any number of other applications can open it for INPUT at the same time; EXCLUSIVE means that your app wants to be the only app opening the queue.
An MQ application works with one message at a time (the next message - this is the default behavior. If your application loops through the code, this behavior will be repeated.
When you say you want to delete a particular message, how will you identify the message you want to delete? By the content of the application data portion of the message? If so, you will need to open the queue for input (MQOO), then mqget with browse (see MQGMO) each message (next message), then examine the application data, and mqget the message (destructively) under cursor (see MQGMO).
If you know the msgid and/or correlid of the specific message you want to delete, place these in the msgid and correlid of the MQMD before the mqget (destructively).
There are lots of sample programs available for you to look at. Go to Mr. Google, and look for mq+samples. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
|