Author |
Message
|
varholl |
Posted: Tue Sep 12, 2006 6:39 am Post subject: Need to fing messages on queue |
|
|
Novice
Joined: 23 May 2006 Posts: 21 Location: Argentina
|
Hi all, its been a long time, i need some help again..
i need to look out in a queue and find messages that are coming to me..
i little words, i need to be legacy, so i need to read message and response them.. but i dont have any msgid to get messages from queue, how can i read messages from a queue if i dont have any msgId?
Thank you so much _________________ Consulting on web based Systems. |
|
Back to top |
|
 |
mvic |
Posted: Tue Sep 12, 2006 6:59 am Post subject: Re: Need to fing messages on queue |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
varholl wrote: |
Hi all, its been a long time, i need some help again..
i need to look out in a queue and find messages that are coming to me..
i little words, i need to be legacy, so i need to read message and response them.. but i dont have any msgid to get messages from queue, how can i read messages from a queue if i dont have any msgId?
Thank you so much |
Will you be happy with reading all messages on the queue? If not, then what criteria do you want to use to select a message? |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Sep 12, 2006 7:00 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
If you don't specify a message ID on the get, then you will get the FIRST message on the queue. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
varholl |
Posted: Tue Sep 12, 2006 7:09 am Post subject: thanks |
|
|
Novice
Joined: 23 May 2006 Posts: 21 Location: Argentina
|
hi all, i need to read all message but dont response everyone, just need to response a selected group of messages, in a point of view a could use the correlid to identify them.. can i filter the messages with the correlid?
thank you very much! _________________ Consulting on web based Systems. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Sep 12, 2006 7:30 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Please read the Application Programming Guide. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
varholl |
Posted: Tue Sep 12, 2006 7:34 am Post subject: |
|
|
Novice
Joined: 23 May 2006 Posts: 21 Location: Argentina
|
could you help me with another way?, i dont have the time to read all the guide.. thank you! _________________ Consulting on web based Systems. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Sep 12, 2006 8:04 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
If you don't have time to read the whole guide, then you can search the guide.
If you don't have time to search the guide, you don't have time to solve this problem. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
bruce2359 |
Posted: Tue Sep 12, 2006 3:18 pm Post subject: |
|
|
Guest
|
Problem:
How to find a message in a queue without using MSGID and/or CORRELID fields (or GROUPID for that matter). This means that you need to look at other fields in the Message Descriptor or the application data.
Solution:
Write an application (in the language of your choice) that MQGETs the first message with BROWSE option. BROWSE leaves the message in the queue.
Examine the message (message descriptor or your application data) for whatever you are looking for. If you find a message that meets your criteria, do a MQGET under browse cursor to destructively read the message from the queue.
If the message doesn't meet your criteria, loop back to MQGET the next message with BROWSE.
The MQ Application Programmers Reference describes MQGET and the various options. Sample programs are easy to find on the net. Do a Google search for MQGET sample program. |
|
Back to top |
|
 |
varholl |
Posted: Wed Sep 13, 2006 4:41 am Post subject: |
|
|
Novice
Joined: 23 May 2006 Posts: 21 Location: Argentina
|
thank you so much it was very helpfull!!  _________________ Consulting on web based Systems. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Sep 13, 2006 4:45 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
And then, three months later in the middle of the night when the MQ operator calls you to complain that your queue is full... _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
varholl |
Posted: Wed Sep 13, 2006 9:19 am Post subject: |
|
|
Novice
Joined: 23 May 2006 Posts: 21 Location: Argentina
|
How, could it be full if i re-Get the message when i find one that i have to answer?
I do search as bruce said, when i find a message for me.. i re-Get the message with the msgId getted.
Think about it jef.. _________________ Consulting on web based Systems. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Sep 13, 2006 9:27 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You said you only needed to respond to some of the messages, and not others
Bruce2359's algorithm, if implemented for your scenario, will only remove messages from the queue that you have decided you want to respond to.
That means your queue will fill up.
Also, Bruce2359's algorithm is entirely more complicated than it needs to be for your scenario. There's no reason to decide whether to respond to a message BEFORE you destructively get it from the queue. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kevinf2349 |
Posted: Wed Sep 13, 2006 10:07 am Post subject: |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
As you said......
Quote: |
could use the correlid to identify them |
Why not just set match options to match on Correlid? Of course that will require you to read the APG so maybe that isn't such a good option?
Of course Jeff is still correct about the queue filling up if messages remain on the queue. |
|
Back to top |
|
 |
varholl |
Posted: Wed Sep 13, 2006 1:05 pm Post subject: |
|
|
Novice
Joined: 23 May 2006 Posts: 21 Location: Argentina
|
Why, you always think you know everything, I NEED TO RESPOND SOME MESSAGES BECAUSE OTHER PROGRAMS WILL RESPOND THE REST.. SO ..
I DONT IF THE QUEUE WILL FILL UP.. BECAUSE ITS NOT MY RESPONSABILITY TO RESPOND EVERYONE.. _________________ Consulting on web based Systems. |
|
Back to top |
|
 |
vennela |
Posted: Wed Sep 13, 2006 1:25 pm Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
varholl wrote: |
Why, you always think you know everything |
Because you are the one asking questions and they are the one answering.
Anyway, your question was not very clear (atleast to me) and with the responses you got, you should be glad you figured out a way for the problem.
Please keep asking questions and contribute to the forum with your own solutions. |
|
Back to top |
|
 |
|