Depending on the volume of messages and the criticality of response time
you could just do gets without any wait on n-1 queues and a get with wait
on the first/last queue in the list set at a reasonable polling interval.
You wont use up too much cpu with a wait time of 500 milliseconds if you
are polling 5-10 queues and it gets you around the need to do
multi-threading. Pick the most active queue to do your waiting on. If it
truly is a high volume time citical application then you'll need to write
some multi-threaded code, Java may well be your best candidate here for the
relative ease and transparency of its threading.

Regards
Tim A



                      Gonzalo Diethelm
                      <gonzalo.diethelm@A        To:       [EMAIL PROTECTED]
                      DITIVA.COM>                cc:
                      Sent by: MQSeries          Subject:  Re: Demultiplexing instead 
of polling?
                      List
                      <MQSERIES@AKH-WIEN.
                      AC.AT>


                      04/01/2003 23:03
                      Please respond to
                      MQSeries List





I will rephrase my question, in the hopes to elicit
answers from the more knowledgeable.

I need to monitor several queues for incoming messages,
from a single client program. I can see one way of doing
it would be to have several threads, each with a loop
polling on a specific queue. There are several problems
with this approach: it requires threads, with all the
associated issues regarding their proper termination,
and it implies an active, rather than passive, role.

The other way this is usually handled is to have some
means of demultiplexing, akin to what is provided by the
select() call in UNIX environments: you put a reference
to each resource you want to monitor inside a data
structure, and pass that to a call that basically:

* implies NO ACTIVITY on the calling program.
* times out after a specified amount of time.
* returns when there is activity on any of the resources.

My question is: is this passive demultiplexing mechanism
supported in any way under MQ? I believe it is supported
somehow in z/OS (or whatever it is called), but not in
general; is this correct?

Thanks,


--
Gonzalo A. Diethelm
[EMAIL PROTECTED]


> -----Original Message-----
> From: Gonzalo Diethelm [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 03, 2003 16:29
> To: MQSeries List
> Subject: Demultiplexing instead of polling?
>
>
> [Probably a FAQ]
>
> When one issues an MSGGET, I understand the call is synchronous,
> that is, the caller waits until the call returns (or until a
> user-specified timeout expires). Is there any way to do a
> select()-like call, specifying several queues, that will return
> when ANY of the queues has relevant information to notify to the
> caller, such an incoming message, or availability to write, or
> an error condition? This select() call is a typical UNIX call
> used in socket programming (just in case anybody wonders).
>
> I'm thinking about a program that would monitor many MQ queues
> and would move messages around, to other MQ queues or even to
> other MOMs. Short of using one thread per monitored queue, how
> can I monitor several queues at the same time?
>
> Thanks,
>
>
> --
> Gonzalo A. Diethelm
> [EMAIL PROTECTED]
>

Instructions for managing your mailing list subscription are provided in
the Listserv General Users Guide available at http://www.lsoft.com
Archive: http://vm.akh-wien.ac.at/MQSeries.archive

Instructions for managing your mailing list subscription are provided in
the Listserv General Users Guide available at http://www.lsoft.com
Archive: http://vm.akh-wien.ac.at/MQSeries.archive

Reply via email to