Author |
Message
|
brgmo |
Posted: Thu Dec 18, 2003 12:44 pm Post subject: how to poll a queue continuosly |
|
|
Master
Joined: 03 Jun 2002 Posts: 227
|
Hi All
How to poll a queue continuously for incoming messages from several applications. Are we supposed to write some exra code for that or is thereany facility provided by mqseries for that.
Regards
brgmo |
|
Back to top |
|
 |
skn |
Posted: Thu Dec 18, 2003 1:10 pm Post subject: |
|
|
 Centurion
Joined: 21 May 2003 Posts: 112 Location: Dallas
|
You can trigering mechanism to kick off your app when messages come in.
I dont think there is such a facility in MQ as such.Or you could let your app do the polling(ex JMS listeners can block on a queue for messages). |
|
Back to top |
|
 |
JoePanjang |
Posted: Thu Dec 18, 2003 6:37 pm Post subject: |
|
|
Voyager
Joined: 10 Jul 2002 Posts: 88 Location: Dengkil MALAYSIA
|
with trigger first on, do the MQGET with unlimited..  |
|
Back to top |
|
 |
EddieA |
Posted: Thu Dec 18, 2003 6:46 pm Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Why do that. Either use triggering or use an unlimited wait. Mixing the two doesn't make any sense.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
JoePanjang |
Posted: Thu Dec 18, 2003 11:51 pm Post subject: |
|
|
Voyager
Joined: 10 Jul 2002 Posts: 88 Location: Dengkil MALAYSIA
|
if without trigger on, i will not get the trigger data(qname). In this case with the unlimited MQGET, how do i know the qname(without manually hardcode it)? Any chance to get it somewhere else?  |
|
Back to top |
|
 |
zpat |
Posted: Fri Dec 19, 2003 12:56 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Don't "poll" the queue - always MQGET with WAIT. This allows the queue manager to efficiently wait for you and immediately a message is available that satisifies your GET conditions it will be returned to you.
The wait interval is the maximum time before ending the GET without a message (2033). GET with WAIT does not cause any extra delay if messages are available, whereas polling will introduce an interval between retries.
Don't do an unlimited wait if you wait to be able to shut your application down. Get with wait for say 60 seconds, check for application shutdown, if not shutting down then reissue the Get with wait (and then repeat etc).
In terms of the queue name, most programs read this from their command line parameter or from an .ini file in a similar way to any other environmental variables. |
|
Back to top |
|
 |
mrlinux |
Posted: Fri Dec 19, 2003 9:18 am Post subject: |
|
|
 Grand Master
Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA
|
If you do mqget with Wait unlimited, you could develop a special shutdown
message and then you could gracefully exit the application. _________________ Jeff
IBM Certified Developer MQSeries
IBM Certified Specialist MQSeries
IBM Certified Solutions Expert MQSeries |
|
Back to top |
|
 |
EddieA |
Posted: Fri Dec 19, 2003 9:43 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
And don't forget to use Fail If Quiescing. (Where avaialable )
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
|