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 » IBM MQ API Support » Modifying a specified message in the Queue

Post new topic  Reply to topic
 Modifying a specified message in the Queue « View previous topic :: View next topic » 
Author Message
VijayGoparaju`
PostPosted: Sun Sep 14, 2008 7:55 pm    Post subject: Modifying a specified message in the Queue Reply with quote

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
View user's profile Send private message
gbaddeley
PostPosted: Sun Sep 14, 2008 8:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
VijayGoparaju`
PostPosted: Sun Sep 14, 2008 8:23 pm    Post subject: Reply with quote

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
View user's profile Send private message
Mr Butcher
PostPosted: Sun Sep 14, 2008 11:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
VijayGoparaju`
PostPosted: Sun Sep 14, 2008 11:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
zpat
PostPosted: Mon Sep 15, 2008 12:14 am    Post subject: Reply with quote

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
View user's profile Send private message
VijayGoparaju`
PostPosted: Mon Sep 15, 2008 12:21 am    Post subject: Reply with quote

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
View user's profile Send private message
Mr Butcher
PostPosted: Mon Sep 15, 2008 12:52 am    Post subject: Reply with quote

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
View user's profile Send private message
VijayGoparaju`
PostPosted: Mon Sep 15, 2008 1:06 am    Post subject: Reply with quote

Acolyte

Joined: 26 Aug 2008
Posts: 72

Sorry Butcher,

I am just conforming.

Thank you very much,
Vijay...
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Sep 15, 2008 2:15 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
dkeister
PostPosted: Mon Sep 15, 2008 6:13 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » Modifying a specified message in the Queue
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.