Author |
Message
|
VijayGoparaju` |
Posted: Sun Sep 14, 2008 7:55 pm Post subject: Modifying a specified message in the Queue |
|
|
Acolyte
Joined: 26 Aug 2008 Posts: 72
|
Hello All,
I have a requirement, I have to modify a particular message in the Queue.But the Queue is adding it as a new message.Can any one please tell me how to modify that message not to add it as a new message.
I have opened the Queue in output mode:
queue = queueManager.AccessQueue( txtSearchQueue.Text, MQC.MQOO_INQUIRE | MQC.MQOO_OUTPUT | MQC.MQOO_FAIL_IF_QUIESCING );
Thanks & Regards,
Vijay...
Last edited by VijayGoparaju` on Mon Sep 15, 2008 2:23 am; edited 1 time in total |
|
Back to top |
|
 |
gbaddeley |
Posted: Sun Sep 14, 2008 8:12 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
Its not possible to modify a message in-place on a queue. You need to GET the message (destructively) into the program memory, modify its contents, and then PUT it back on to the queue. Note that this changes the FIFO order of the message if its not the only message on the queue. _________________ Glenn |
|
Back to top |
|
 |
VijayGoparaju` |
Posted: Sun Sep 14, 2008 8:23 pm Post subject: |
|
|
Acolyte
Joined: 26 Aug 2008 Posts: 72
|
Yaa I got the specified message from the Queue and Displayed in a text box then I modifiyed that Message in the Text box and put that message in the Queue by using:
queueMessage.WriteString(message.Replace(txtSearchMsgDetails.Text.ToString(), txtSearchMsgDetails.Text.ToString()));
But, This Text is placed as a New Message in the Queue,But not putting it at the same position..
Please Help,
Thanks,
Vijay... |
|
Back to top |
|
 |
Mr Butcher |
Posted: Sun Sep 14, 2008 11:13 pm Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
did you read the answer from gbaddeley? if so, which part did you not understand? _________________ Regards, Butcher |
|
Back to top |
|
 |
VijayGoparaju` |
Posted: Sun Sep 14, 2008 11:39 pm Post subject: |
|
|
Acolyte
Joined: 26 Aug 2008 Posts: 72
|
I didnt get, So please tell me is it possible to Edit a Message in the Queue and place it in the same location (OR) Not Possible? Just we can put it as a new message in the Queue? |
|
Back to top |
|
 |
zpat |
Posted: Mon Sep 15, 2008 12:14 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
gbaddeley wrote: |
Its not possible to modify a message in-place on a queue. |
|
|
Back to top |
|
 |
VijayGoparaju` |
Posted: Mon Sep 15, 2008 12:21 am Post subject: |
|
|
Acolyte
Joined: 26 Aug 2008 Posts: 72
|
Are you sure, We can get that message from the Queue and we can Display it, Is it not possible to edit the message and place it in the same position? Please tell me.
Thanks,
Vijay... |
|
Back to top |
|
 |
Mr Butcher |
Posted: Mon Sep 15, 2008 12:52 am Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
how many "no" do you need to start believing?
i suggest you read the manuals and make up your own opinion if you do not trust the answers here..... _________________ Regards, Butcher |
|
Back to top |
|
 |
VijayGoparaju` |
Posted: Mon Sep 15, 2008 1:06 am Post subject: |
|
|
Acolyte
Joined: 26 Aug 2008 Posts: 72
|
Sorry Butcher,
I am just conforming.
Thank you very much,
Vijay... |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Sep 15, 2008 2:15 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
And you HAVE to understand that a queue IS NOT a database !!!  _________________ MQ & Broker admin |
|
Back to top |
|
 |
dkeister |
Posted: Mon Sep 15, 2008 6:13 am Post subject: |
|
|
Disciple
Joined: 25 Mar 2002 Posts: 184 Location: Purchase, New York
|
It sounds like you want to do things with messages that require a fair amount of experience with MQSeries, a clear understanding of the interface, and may not be possible based on business requirements. The fact that you ask about editing messages on the queue, and from your other posts, I think you do not have enough experience or knowledge of MQSeries to know HOW or WHEN you can do certain things and WHAT the risks and exposures are.
You cannot edit messages on the queue, but you can get each message, edit if appropriate, and put it to the end of the queue. While not foolproof, here are some suggestions.
Overview. Browse to find the message you want to change. Then get each message from the queue and put it to the queue (at the end). When you get to the message you want to change, substitute the changed message text. You have to browse the first message on the queue before getting it to know when to stop. See steps 1-4:
1. Browse the message you want to change. Remember the MsgID, change text as needed.
2. Next browse the first message from the queue. Remember this MsgID also.
(at this point you have the MsgID of the message you want to change and the MsgID of the first message on the queue. They might be the same).
3. Now destructively get the first message on the queue.
a. If it is not the message you want to change, put it at the end of the queue supplying the mqmd from the get. (You will have to understand PMO options for this.)
b. If it is the message with the MsgID from step 1, put it at the end of the queue supplying the MQMD from the get (as with 3a), but use the text changed in step 1.
4. Browse the first message on the queue.
a. If the MsgID matches the original 'first message' identified is step 2, stop.
b. If the MsgID does not match, go to step 3.
This may not work if messages are being put to the queue while this operation is in progress because they would get mixed with the messages you are getting/putting.
MQExerciser has implemented this function. But in a dynamic environment, I know of no way to guarantee the results unless you know for sure no additional messages are being put on the queue. _________________ Dean Keister |
|
Back to top |
|
 |
|