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 » General Discussion » Msg Routing -

Post new topic  Reply to topic
 Msg Routing - « View previous topic :: View next topic » 
Author Message
rashidg
PostPosted: Tue Jul 22, 2003 9:48 pm    Post subject: Msg Routing - Reply with quote

Novice

Joined: 03 Mar 2002
Posts: 19

One scenario -

Client puts msg in Q1. In 5 secs if msg is still in the queue Q1 then I have to send the same msg from Q1 to Q2, same for Q2 also - if msg is still in the queue Q2 for 5 secs, then same msg has to be send to Q1 again. if in 20 secs no app is picking up the msg from Q1 it should be finally placed to Q3.

Please sugegst
Back to top
View user's profile Send private message
Michael Dag
PostPosted: Tue Jul 22, 2003 10:59 pm    Post subject: Reply with quote

Jedi Knight

Joined: 13 Jun 2002
Posts: 2607
Location: The Netherlands (Amsterdam)

What is reading Q1, Q2 and Q3, can you please elaborate on what you are trying to do?
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
bduncan
PostPosted: Wed Jul 23, 2003 12:05 am    Post subject: Reply with quote

Padawan

Joined: 11 Apr 2001
Posts: 1554
Location: Silicon Valley

Yes, there is probably some way you can architect your system such that you won't need to move the messages around if they don't get processed in a timely manner.
However, if you are unable to avoid it, then here's what I'd suggest doing.
Have a small application that browses the messages on Q1. Since it is just browsing, the MQGETs aren't actually removing the messages from the queue. The application can then inspect the PUTTIME attribute to figure out how long the message has existed since it was put. Note the distinction between this and what you were asking, which was "how long the message was sitting on Q1." There isn't any good way to measure this. The best you can do is how long since the message was put. Since the message will end up on Q1 after a very short period of time during normal operations, you can usually depend on these two values being pretty close. Now, if your application notices that a message has been around for more than 5 seconds, it will do a second MQGET (matching against the MsgId it got in the browse) to actually remove the message from the queue. It will also have to handle the situation where the real processing application grabbed the message between the time it browsed it and tried to remove it. It can then put this message on Q2.
_________________
Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator
Back to top
View user's profile Send private message Visit poster's website AIM Address
rashidg
PostPosted: Wed Jul 23, 2003 4:05 am    Post subject: Reply with quote

Novice

Joined: 03 Mar 2002
Posts: 19

Thanks for your reply -

I come up with a sol. This is like this -

I will define queue Q1 as a trigger queue, after 5 secs, msg will be sent to initiation queue which will start Process Def, PD will start the app and app will call MQPUT to put the msg in Q2. (And same applies to Q2)

But here I saw one issue how I configure the queue Q1 to raise trigger based on msg time say 5 secs. In the doc I can only see defineing queue for trigger using Msg Depth, but the question is how I will raise the trigger if msg is there in the queue for 5 secs.

Please throw some light
Back to top
View user's profile Send private message
rashidg
PostPosted: Wed Jul 23, 2003 5:10 am    Post subject: Reply with quote

Novice

Joined: 03 Mar 2002
Posts: 19

Please suggest -----------
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Jul 23, 2003 5:14 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

rashidg wrote:
the question is how I will raise the trigger if msg is there in the queue for 5 secs.

Please throw some light

You can't, not really.

Not without writing your own trigger monitor that sleeps for five seconds after it receives a trigger message from the initiation queue.
Back to top
View user's profile Send private message
bduncan
PostPosted: Wed Jul 23, 2003 12:51 pm    Post subject: Reply with quote

Padawan

Joined: 11 Apr 2001
Posts: 1554
Location: Silicon Valley

Assuming for a moment that you could set a trigger based on how long a message has been on the queue (which you can't), the method you are describing will still cause all kinds of problems.
Take the following scenario:
1. Message 1 arrives on the queue.
2. The queue manager places a trigger message on the initiation queue.
3. Message 2 arrives on the queue.
4. The trigger monitor starts your application.
5. How does your application know which message has been there for 5 seconds? It has no way of knowing which of the two messages caused it to get triggered.

The only way I can see to solve your problem is to use the PUTTIME attribute in the MQMD as I described before.
_________________
Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator
Back to top
View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » Msg Routing -
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.