Author |
Message
|
Abraham Issac |
Posted: Sat Jun 08, 2002 3:03 am Post subject: Basic Doubt on MQGET |
|
|
 Newbie
Joined: 24 May 2002 Posts: 5 Location: Mumbai
|
Hi,
Is it necessary to close the queue after each read. Cant we open the queue and go on reading using MQGET. We faced some problems on doing so. |
|
Back to top |
|
 |
bob_buxton |
Posted: Sat Jun 08, 2002 6:02 am Post subject: Re: Basic Doubt on MQGET |
|
|
 Master
Joined: 23 Aug 2001 Posts: 266 Location: England
|
Abraham Issac wrote: |
Hi,
Is it necessary to close the queue after each read. Cant we open the queue and go on reading using MQGET. We faced some problems on doing so. |
What Problems on what platform? You can reead as many messages as
you like from a queue. _________________ Bob Buxton
Ex-Websphere MQ Development |
|
Back to top |
|
 |
mqonnet |
Posted: Sat Jun 08, 2002 6:05 am Post subject: |
|
|
 Grand Master
Joined: 18 Feb 2002 Posts: 1114 Location: Boston, Ma, Usa.
|
You can always open the queue and keep it open as long as you want and keep reading off the queue. In fact this is one of the most common programs developed on MQ. Take the example of the trigger monitor which keeps the init queue open and keeps polling for the messages.
The only thing to bear in mind is the complexity of this Get. If you are doing a syncpointed operation, then it might hinder your app as well others. Also if you are doing a destructive get while the message is being browsed by someone else. In short, if your app has not opened the queue EXCLUSIVELY, then you might run into sitations and problems.
As for opening and closing the queue after each get is concerned, it is very expensive. Since each open and close involves lot of process involved within MQ, and would degrade performance. You can check on the performance statistics on IBM Site to see how it makes the difference.
By the way what problems did you face.
Cheers.
Kumar _________________ IBM Certified WebSphere MQ V5.3 Developer
IBM Certified WebSphere MQ V5.3 Solution Designer
IBM Certified WebSphere MQ V5.3 System Administrator |
|
Back to top |
|
 |
dgolding |
Posted: Sun Jun 09, 2002 11:36 pm Post subject: |
|
|
 Yatiri
Joined: 16 May 2001 Posts: 668 Location: Switzerland
|
Is your problem you can read one message, but subsequent GETs fail with a 2033? This is caused my not resetting your Msg and Corel ID fields before you issue the GET. Just a thought... |
|
Back to top |
|
 |
bduncan |
Posted: Mon Jun 10, 2002 6:41 am Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
Yes, be sure to use the search tool on this site to look at some threads that explain how to clear out the MsgId and CorrelId after MQGETs in order to get multiple messages. _________________ Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator |
|
Back to top |
|
 |
Peg |
Posted: Wed Jun 26, 2002 2:32 pm Post subject: multiple MQGET from a queue |
|
|
Newbie
Joined: 26 Jun 2002 Posts: 3 Location: New York
|
It could depend upon whether you have syncpoints. If your connection and object handles are still valid, you should be able to continue to issue MQGET. If, however, you have syncpoints (and they may be unavoidable, such as in an IMS tp application) and those handles are no longer available, you will have to re-open and perhaps even re-connect. That has been my experience. |
|
Back to top |
|
 |
|