|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Message Pagination with .NET API |
« View previous topic :: View next topic » |
Author |
Message
|
tenalibabu |
Posted: Tue Sep 20, 2005 12:29 pm Post subject: Message Pagination with .NET API |
|
|
Newbie
Joined: 20 Sep 2005 Posts: 3
|
Dev Environment:
.NET 2003
amqmdnet.dll from CSD 10 for WebSphere MQ v5.3
Question:
I am trying to create an administration application that will paginate through messages within a queue. I have been able to write C# code to do non-destructive gets to browse to the first message using MQGMO_BROWSE_FIRST and MQGMO_BROWSE_NEXT for messages thereafter.
But, how do I browse to a particular message say message 11, 32 or 99 within 100 messages? Granted that I have been able to get messages at a particular position with the following code:
..
mqMsg.MessageId = this.GetByteFromString("414D512050534D5351303120202020203DBC2E4320000D01");
mqGetMsgOpts.MatchOptions = MQC.MQMO_MATCH_MSG_ID ;
mqGetMsgOpts.Options = MQC.MQGMO_BROWSE_FIRST;
..
But the above code is not helpful in that I don't have the message id at my disposal until I obtain if from somewhere. I have seen a number of 3rd party tools implement this functionality and I would like to know how they did it. For example, the WMQ Tool (www.niratul.com) has this functionality. On the other hand MQ Visual Browse (www.capitalware.biz) seems to return all the messages in a queue. This is way too inefficient for my application because my queue may contain an undeterminate amount of messages.
Do I need to use the PCF (IBM.WMQ.PCF) classes within the API to accomplish this? If so, there is not much documentation out there about the PCF classes.
I have searched every corner of this site and others and have found nothing so far. Any help would be greatly appreciated. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Sep 20, 2005 12:34 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
If you wish to index into a particular message on a queue, you will have to create an index.
A browse of the entire queue, with accept truncated messages, and a 0 or 1 byte buffer will give you the MQMDs for the entire queue from which to do this.
PCF won't help.
There is tons of documentation out there about PCF messages. The .NET interface, on the other hand, may or may not be complete, but should still be reasonably documented at the level of "how to build and send some particular PCF message, and process the replies", even if not at the "This is the message for INQUIRE QUEUE". _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
tenalibabu |
Posted: Wed Sep 21, 2005 4:38 am Post subject: Re: Message Pagination with .NET API |
|
|
Newbie
Joined: 20 Sep 2005 Posts: 3
|
Thanks for the quick reply! Let me reiterate your statement so that I am sure that I understand it correctly.
Quote: |
Iterate through every message in the queue and build a client side index which contains the set {Position, MsgId}. Then use the locally available index of Message IDs to retrieve messages say 1-10, 54-64 or 99.
|
What are the performance implications of this method? I may have over a 1000 messages and the depth may change as the user uses the application. It maybe expensive for me to rebuild the index a number of times while the application is running. Unless it is not as bad as I think it is...Please let me know.
Could you point me towards some good PCF API documentation? I understand that it may not be the .NET one but I am sure it will help with some of the other functionality I am building.
Thanks! |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Sep 21, 2005 4:44 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
The performance implications of this method are clear. Every refresh of the index is going to cost you n gets, where n is the number of messages on the queue.
I am not aware of any other way to do this. Consequently, it's likely that *every* admin tool provider out there does some varient on this technique. Ergo, your tool will likely perform no worse than anyone elses.
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.csqzac.doc/csqzac04.htm _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
zpat |
Posted: Wed Sep 21, 2005 6:25 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
If they might be large messages, you can optimise the process by only getting a portion of the message data (ie - accept truncated message) when you are browsing the queue. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|