Author |
Message
|
rvikky |
Posted: Fri May 12, 2006 3:33 am Post subject: To avoid opening multiple windows while triggering |
|
|
Apprentice
Joined: 14 Feb 2006 Posts: 32 Location: Bangalore
|
I'm using triggering for every message which comes to the queue. The trigger will call a batch file which runs a jsp file in IE.
I'm using windows.
Every time a new message comes, it runs the jsp file in a new IE window. I want to restrict it to single window. is there a way to do it? |
|
Back to top |
|
 |
kevinf2349 |
Posted: Fri May 12, 2006 5:21 am Post subject: |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
Quote: |
I'm using triggering for every message which comes to the queue |
Why? I have yet to hear a really good reason for doing this so I am extremely interested in understanding why someone would need to trigger on every.
Quote: |
I want to restrict it to single window. is there a way to do it? |
Yes...trigger on first! |
|
Back to top |
|
 |
n1ghtrain |
Posted: Sun May 14, 2006 8:10 pm Post subject: |
|
|
 Apprentice
Joined: 23 Mar 2006 Posts: 48 Location: Bangalore
|
In any case ,(imo) rvikky's query is how to avoid opening new browser windows on subsequent triggers .. A way to run 'em in the same window .. |
|
Back to top |
|
 |
n1ghtrain |
Posted: Sun May 14, 2006 8:24 pm Post subject: |
|
|
 Apprentice
Joined: 23 Mar 2006 Posts: 48 Location: Bangalore
|
Quote: |
I have yet to hear a really good reason for doing this so I am extremely interested in understanding why someone would need to trigger on every
|
A low-volume queue that was going to be serviced by a single ECB and you didn't want to start up a new process every time a message arrived... |
|
Back to top |
|
 |
elvis_gn |
Posted: Sun May 14, 2006 8:36 pm Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi,
n1ghtrain wrote: |
rvikky's query is how to avoid opening new browser windows on subsequent triggers .. A way to run 'em in the same window .. |
Use trigger on first and get all the messages in the same window.
n1ghtrain wrote: |
you didn't want to start up a new process every time a message arrived... |
It is just for this reason that you would want to have the trigger on First and use the application to fetch all the messages on queue currently... |
|
Back to top |
|
 |
kevinf2349 |
Posted: Mon May 15, 2006 5:02 am Post subject: |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
Quote: |
In any case ,(imo) rvikky's query is how to avoid opening new browser windows on subsequent triggers .. A way to run 'em in the same window .. |
Whilst my reply didn't address the question directly, it was supposed to make him actually think about the the design of the application.
What did your post do to help him?
I still have yet to find a reason to trigger on every. Laziness or bad design is not a good reason to do this.
Quote: |
A low-volume queue that was going to be serviced by a single ECB and you didn't want to start up a new process every time a message arrived... |
OK...trigger on first and then wait indefinately if you want to avoid the 'start up' over head. Either that or trigger on first and end when you get a 2033. The next time a message arrives the application restarts. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Mon May 15, 2006 2:39 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
kevinf2349 wrote: |
I still have yet to find a reason to trigger on every. Laziness or bad design is not a good reason to do this. |
How about an app that takes a few minutes to process a message. You want it triggered. But messages arrive more frequently sometimes and you don't want them waiting in the queue if the app is working on a previous one. So you trigger on Every to get multiple long running processes servicing the queue when needed? _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon May 15, 2006 3:10 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
So you trigger on Every to get multiple long running processes servicing the queue when needed?
Ummm...
I think this would not work. Trigger on every is going to trigger on almost every message. So there's no way for it to tell that message 5, for example, is okay to trigger on because the rest of the messages are going to be processed in a timely manner by the one already started instance of the program.
I think you would have to write a fairly complicated traffic cop pattern that would essentially post the trigger events into an internal data structure from each trigger-on-every event, and then determine when a new instance of the program should be started or not.
So, really, you're better off writing your own trigger monitor that handles this kind of workload balancing.
Plus, you can take a few simple steps to ensure that someone doesn't manually create an MQTRM2 that does, for example "del *.*". _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Mon May 15, 2006 3:43 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
jefflowrey wrote: |
So you trigger on Every to get multiple long running processes servicing the queue when needed?
Ummm...
I think this would not work. Trigger on every is going to trigger on almost every message. So there's no way for it to tell that message 5, for example, is okay to trigger on because the rest of the messages are going to be processed in a timely manner by the one already started instance of the program.
|
Because each mesage will most likely take a long time to process, you assume every one will, and so set to trigger the every so that every time a message lands on the queue, a trigger message is generated. The code is written to read until 2033, even though 99.99999% of the time when the app finished with the first message it was working on, it will find an empty queue because other instances have bene triggered to handle other messages. The app goes until 2033 to circumvent the problem that occasionally you'll find messages on the triggered every queue, and as new messages arrive, you only get triggers for the newly arriving messsages, not any existing ones. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon May 15, 2006 6:20 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Okay, that's not what I thought you meant. I thought you meant something like "start the program only once, but if there are a whole bunch of trigger messages in a short time, then start the program again". _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|