Author |
Message
|
bigmq |
Posted: Thu Sep 30, 2004 7:14 am Post subject: Real- time acknoledge response Message help! |
|
|
Novice
Joined: 14 Sep 2004 Posts: 19
|
Hi, all
I am developing a application by using MQ base Java, here are some problems i am struggling at, since i am a newbie for MQ, any helps for my dump questions will be so appeciated!
When there is a new message coming into the queue, how do i know its coming and start my getmessage program to get the message out of queue right away? Any sample codes.
Thanks |
|
Back to top |
|
 |
siliconfish |
Posted: Thu Sep 30, 2004 8:27 am Post subject: |
|
|
 Master
Joined: 12 Aug 2002 Posts: 203 Location: USA
|
You can set up the queue for TRIGTYPE=FIRST/EVERY/DEPTH (depending on ur situation) and set the Java program as the Triggered application. So when a message is put to a queue the queue manager generates a TRIIGGER message and your application can be triggered to pickup those messages from the application queue. |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Sep 30, 2004 8:35 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Yes, he could use triggers.
Or he could read the Application Programming Guide to find out the best practices for this Request/Reply Pattern, and use Get with WAIT. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
bower5932 |
Posted: Thu Sep 30, 2004 9:51 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
|
Back to top |
|
 |
bigmq |
Posted: Thu Sep 30, 2004 11:10 am Post subject: |
|
|
Novice
Joined: 14 Sep 2004 Posts: 19
|
Many thanks for everybody, by the way, jefflowrey, your company doesn't call me.
I thought i could put my java program into a unix cron and run it like every 5 minutes to get message out and put back a acknoledge message to queue. This sound stupid, right? |
|
Back to top |
|
 |
siliconfish |
Posted: Thu Sep 30, 2004 11:23 am Post subject: |
|
|
 Master
Joined: 12 Aug 2002 Posts: 203 Location: USA
|
Quote: |
I thought i could put my java program into a unix cron and run it like every 5 minutes to get message out and put back a acknoledge message to queue. This sound stupid, right? |
I don't think its a stupid idea.
Actually people do have use cron jobs to remove the expired/information messages but they run them at the end of the day or long intervals.
I am not sure how the 5min interval matters.
But IMO its a matter of design whether to use MQ facilities available to you out of the box or use non MQ. |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Sep 30, 2004 11:38 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
bigmq wrote: |
Many thanks for everybody, by the way, jefflowrey, your company doesn't call me. |
That's simply not true. My sales guy left you three messages, and you have not returned them. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
bower5932 |
Posted: Thu Sep 30, 2004 11:46 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
bigmq wrote: |
I thought i could put my java program into a unix cron and run it like every 5 minutes to get message out and put back a acknoledge message to queue. This sound stupid, right? |
If your program is going to be running like this, I would suggest going with the triggering. If messages are this infrequent, you could set up a trigger type of every. Your program would get kicked off immediately and it could send its acknowledge message. Who wants to wait 5 minutes if you don't have to? |
|
Back to top |
|
 |
|