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 IBM MQ Support » Basic questions from a newbie

Post new topic  Reply to topic
 Basic questions from a newbie « View previous topic :: View next topic » 
Author Message
pwright
PostPosted: Wed Sep 26, 2001 8:21 am    Post subject: Reply with quote

Newbie

Joined: 25 Sep 2001
Posts: 3
Location: Indianapolis USA

I am new to MQSeries and need help with a fairly simple goal. My background includes coding batch mainframe programs several years ago, and 3 years as an NT network admin. Here's the goal: a customer of ours will be sending a flat file up a WAN link into our queue. We need to trigger an executable written in Visual Basic to perform a database query and put the results back in a queue for outbound transmission. I am told this can be done with one qeue. Is this correct? I also understand that the trigger monitor runs on the initiation queue but I need help understanding how to point the trigger monitor to the application. We're running version 5.2.1 . Any help will be appreciated.

[ This Message was edited by: pwright on 2001-09-26 14:39 ]
Back to top
View user's profile Send private message
kolban
PostPosted: Wed Sep 26, 2001 9:02 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2001
Posts: 1072
Location: Fort Worth, TX, USA

Nice post ... got my attention

First, some more questions that need answered.

o Is your customer MQ enabled? Will they be sending files or will they have a queue manager themselves and thus messages will be sent directly to your queue?
o Same for the response of the processed data, output to a queue or file?

The way triggering works is that when a message arrives on the queue of interest, MQSeries detects this and places a new message on a second, named queue called the initiation queue. This new message states that a trigger event has occurred and names the original queue as the source of the event. The trigger monitor program is constantly watching the initiation queue for such events and, when a trigger message arrives, causes the execution of a named program. This program is passed the trigger event message as a parameter and, from this, can determine which queue to process.

Now, the million dollar question ... are you CERTAIN that you need a triggered application? In many cases, it is simpler to write a demon program which simply watches the primary queue and, when a message arrives there, processes it immediately without having to be started by a trigger event. The draw back on this is that the program has to be started initially. The plus side is that it is much less work that working with triggering functions.
Back to top
View user's profile Send private message
bduncan
PostPosted: Wed Sep 26, 2001 10:15 am    Post subject: Reply with quote

Padawan

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

Agreed: the administration involved with triggered applications is much higher than just having daemon processes - especially on UNIX systems where inittab can automatically restart the daemons if they accidentally die. So especially if you don't have a lot of experience with MQSeries I would recommend sticking to daemons since the 13 or so rules regarding triggering in MQSeries can make life complicated at times...


_________________
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
pwright
PostPosted: Wed Sep 26, 2001 1:30 pm    Post subject: Reply with quote

Newbie

Joined: 25 Sep 2001
Posts: 3
Location: Indianapolis USA

Thanks for the replies gentlemen, here are some of the answers to your questions: Our customer IS running MQSeries on a mainframe. They will be sending a flat file and we MUST run the full server version with our own queue manager, and send a flat file back to them. The overview of the triggering sequence was very helpful. Where can I learn more about configuring/coding daemon processes? The customer is assuming we'll do trigger monitoring, but I would like to consider the alternative(our platform is W2K Server, by the way). What objections do you suppose our customer might have to that - we'll be meeting later in a few days and I would like to be as well informed as I can. Thanks a million.
Back to top
View user's profile Send private message
kolban
PostPosted: Wed Sep 26, 2001 2:00 pm    Post subject: Reply with quote

Grand Master

Joined: 22 May 2001
Posts: 1072
Location: Fort Worth, TX, USA

When you say your customer will be sending a flat file and that you must respond with same, can you clarify? I think you mean that your customer will send an MQSeries message by having an application on MVS put a message to a queue which is defined as remote and exists on your local queue manager. MQSeries will handle the transmission of the message down to your local system. From there, your application will consume the message (however large it is) and perform processing upon its contents. At conclusion your application will generate a new message which will be put on a queue destined back to MVS where it will eventually and finally be consumed.

A demon program is nothing more than a long running MQSeries program... in psudeo code it would be something like:

MQCONN - connect to local queue manager
MQOPEN - open input queue
While not finished
MQGET the next message, waiting if none available
// Process the message
MQPUT1 ... put the response message back to the mainframe
End While
MQCLOSE - close the opened queue
MQDISC - Disconnect from the local queue manager
Back to top
View user's profile Send private message
bduncan
PostPosted: Wed Sep 26, 2001 3:49 pm    Post subject: Reply with quote

Padawan

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

To add a little more detail to the pseudo code Neil provided, you can go about making the daemon work in two ways:
1) In you GetMsgOptions structure set the wait time to WAIT_UNLIMITED. This way, when you call an MQGET and there aren't any messages on the queue, your application will block forever until something arrives.
2) Or, if you need your application do some processing while waiting for messages (logging perhaps) then you can set the wait interval to something smaller than UNLIMITED. Of course, by doing this you are sacrificing CPU cycles as your application will be doing MQGETs over and over until a message arrives as oppossed to option 1 where you do a single MQGET and block.

As far as objections someone may have with this alternative, from my experience, if you have a pretty rock-solid application that you can trust running as a daemon for a long time, then it can be superior to triggering. This mainly has to do with the fact that when you are triggering, you must ensure that the trigger monitor is always running. If it dies or hangs, then nothing will get triggered, and messages will back up. Furthermore, if you are triggering when the first message arrives on the queue (depth goes from 0 to 1), and for whatever reason your application doesn't trigger when this happens (let's say it's a transient condition, like there wasn't enough free memory to run it) then as additional messages come onto the queue, your application won't be triggered again, because the depth is never going from 0 to 1 anymore, it's going 1 to 2, 2 to 3, etc... There is a parameter in the queue manager that you can set called TRIGINT, and this will allow the trigger monitor to retrigger your application after a certain amount of time, but this can complex to administrate, as well as you might end up having multiple copies of your application get launched, which depending on the logic of your application can be a very bad thing....



_________________
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 IBM MQ Support » Basic questions from a newbie
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.