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 » Getting the Before Messages from a Queue

Post new topic  Reply to topic Goto page 1, 2  Next
 Getting the Before Messages from a Queue « View previous topic :: View next topic » 
Author Message
VijayGoparaju`
PostPosted: Fri Sep 19, 2008 12:44 am    Post subject: Getting the Before Messages from a Queue Reply with quote

Acolyte

Joined: 26 Aug 2008
Posts: 72

Hello All,

Please don't take is serious.I have run the loop to get the next Messages but if I want the previous messages how can I get?

queueGetMessageOptions.Options = MQC.MQGMO_BROWSE_NEXT;

This is used to get the NEXT Message but how to get the Previous Message? Is there any method to get the previous message?
Please tell me,
Thanks,
Vijay.
Back to top
View user's profile Send private message
Tibor
PostPosted: Fri Sep 19, 2008 1:40 am    Post subject: Reply with quote

Grand Master

Joined: 20 May 2001
Posts: 1033
Location: Hungary

Vijay, this a message queue, so you can read the 1st message at the 1st call of MQGET. Why do you want to get back if you can start on the foremost message?
Back to top
View user's profile Send private message
atheek
PostPosted: Fri Sep 19, 2008 1:56 am    Post subject: Reply with quote

Partisan

Joined: 01 Jun 2006
Posts: 327
Location: Sydney

I dont think there is something like "MQGMO_BROWSE_PREVIOUS".

One way how you could do this is to open the queue for browse multiple times which gives you multiple browse cursors and handle the cursors within the code as you wish.
Back to top
View user's profile Send private message
bower5932
PostPosted: Fri Sep 19, 2008 2:08 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

If you are browsing next, then you probably already browsed past the previous message. Why didn't you get it "while you were there"? What are you trying to do that involves trying to selectively get individual messages off a queue? You should look into the philosophy of processing all messages on the queue.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
zpat
PostPosted: Fri Sep 19, 2008 2:29 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

If your program saved the message id of the previous message you can easily browse that message by matching the msgid on MQGET.
Back to top
View user's profile Send private message
VijayGoparaju`
PostPosted: Fri Sep 19, 2008 2:37 am    Post subject: Reply with quote

Acolyte

Joined: 26 Aug 2008
Posts: 72

Thank you very much for your replys, But my requirement is like that.
We can get the Depth of the Queue and run a loop backwards but as you said I think there is no method to move the cursor back, Currect?
If so there is no way to get the messages from the Queue in the reverse manner?

Thanks & Regards,
Vijay....
Back to top
View user's profile Send private message
VijayGoparaju`
PostPosted: Fri Sep 19, 2008 2:57 am    Post subject: Reply with quote

Acolyte

Joined: 26 Aug 2008
Posts: 72

zpat wrote:
If your program saved the message id of the previous message you can easily browse that message by matching the msgid on MQGET.




If my program saved the msgid also, how can we go to the previous message to compare the msgid? We have to browse the queue from the first message in that way also.....

Vijay...
Back to top
View user's profile Send private message
zpat
PostPosted: Fri Sep 19, 2008 4:27 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

I don't understand your logic. If you browse forward in the usual way (Browse next) you can keep a note of the previous message's unique message id.

So if you want to go backward you just get that message. If you mean how do you go back again, then you need to have stored all the message ids that you browsed.

RFHUTIL allows browse previous (I assume in this way). It's not hard.
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Fri Sep 19, 2008 5:10 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

VijayGoparaju` wrote:
We can get the Depth of the Queue

If you are designing your program to do gets based on the q depth, you are designing a faulty application.

<sigh>I'll try. If you *search* on this site this has been discussed many times on why this is a bad idea.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
bower5932
PostPosted: Fri Sep 19, 2008 5:57 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

I have no idea what function your program is attempting to fulfill. My advice would be to put yourself in a get message loop and just get all of the messages until there are no more.

What are you trying to do that requires you to:
- browse messages from the beginning of the queue
- browse messages from the end of the queue and go backwards
- get particular messages (sometimes the previous one, current one, and next one)

If you could shed some light on what you are trying to accomplish and what you've actually done, it might be quicker to get an answer.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
fjb_saper
PostPosted: Fri Sep 19, 2008 1:18 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

VijayGoparaju` wrote:

If my program saved the msgid also, how can we go to the previous message to compare the msgid? We have to browse the queue from the first message in that way also.....

Vijay...

Something I quite don't get. Why do you need to compare the msgId?
MQ should have created the msgId automatically. It should have no hidden logic in it. If you have some kind of msg affinity and need to get the message based on order of the msgId you need to have a DB involved in the processing and can only use MQ for transport.

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
bower5932
PostPosted: Fri Sep 19, 2008 3:17 pm    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

Would now be a good time to introduce the concept of message groups and the group id?
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
zpat
PostPosted: Fri Sep 19, 2008 11:28 pm    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

You need to read the MQ primer redbook, then the MQ application programming guide.

Once you understand the principles of MQ programming, we can help with the details.

The apparent lack of any training is a concern - approach your employer and demand it.
Back to top
View user's profile Send private message
VijayGoparaju`
PostPosted: Sun Sep 21, 2008 7:26 pm    Post subject: Reply with quote

Acolyte

Joined: 26 Aug 2008
Posts: 72

bower5932 wrote:
I have no idea what function your program is attempting to fulfill. My advice would be to put yourself in a get message loop and just get all of the messages until there are no more.

What are you trying to do that requires you to:
- browse messages from the beginning of the queue
- browse messages from the end of the queue and go backwards
- get particular messages (sometimes the previous one, current one, and next one)

If you could shed some light on what you are trying to accomplish and what you've actually done, it might be quicker to get an answer.


I am trying to browse messages from the end of the queue and go backwards.Is there any method to read the messages backwards?
Thanks,
Vijay...
Back to top
View user's profile Send private message
Mr Butcher
PostPosted: Sun Sep 21, 2008 10:33 pm    Post subject: Reply with quote

Padawan

Joined: 23 May 2005
Posts: 1716

no, mq has not a "browse previous" function, there is just a "browse next".

some people suggested how you can implement it on your own (browse single messages by message / correlid).

again, why don't you start with some rtmf?
_________________
Regards, Butcher
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » IBM MQ API Support » Getting the Before Messages from a 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.