Author |
Message
|
mickey1691 |
Posted: Wed Sep 25, 2013 12:07 am Post subject: Execute flow at Startup, Execute flow on Shutdown |
|
|
Novice
Joined: 04 Jun 2013 Posts: 19
|
Hi. Is there any way for a message flow to automatically execute on startup? Likewise, is there any way for a message flow to automatically execute on shutdown?
For example. on startup of the application, the app has send a message over tcp/ip to another application on another server that it has now started. It should receive and handle the reply from the other application.
Upon shutdown, it has to send another message to the same server that it is now shutting down. Like before, it should receive and handle the reply from the other application.
Thanks! |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Sep 25, 2013 1:19 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Sure, there are lots of ways this can be done.
Probably not as simply as you'd like, but there are lots of ways it can be done.
Also, it's an extremely terrible idea to have any system notify another system that it's available or unavailable like you're talking about. It makes them very interdependent and tightly coupled. This is bad. |
|
Back to top |
|
 |
mickey1691 |
Posted: Wed Sep 25, 2013 1:43 am Post subject: |
|
|
Novice
Joined: 04 Jun 2013 Posts: 19
|
mqjeff wrote: |
Also, it's an extremely terrible idea to have any system notify another system that it's available or unavailable like you're talking about. It makes them very interdependent and tightly coupled. This is bad. |
That was just an example, not what we're going to implement.
mqjeff wrote: |
Sure, there are lots of ways this can be done.
Probably not as simply as you'd like, but there are lots of ways it can be done.
|
I have some idea for the one during start up, but I have no idea how to implement the one for shutdown. Any suggestions? |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed Sep 25, 2013 1:50 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
mickey1691 wrote: |
I have some idea for the one during start up, but I have no idea how to implement the one for shutdown. Any suggestions? |
It is probably easier to send regular 'keep-alives' to this remote system then when you miss one it sounds the alarm. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Sep 25, 2013 1:58 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I encourage both of you to think outside the box.
Or at least, outside the broker. |
|
Back to top |
|
 |
sridhsri |
Posted: Wed Sep 25, 2013 10:03 am Post subject: |
|
|
Master
Joined: 19 Jun 2008 Posts: 297
|
For startup, you can use the Timer Node. I can't remember the details, but you can have the TimerNode trigger an event when the message flow starts (with a long enough time interval so that it doesn't execute again until the next restart). |
|
Back to top |
|
 |
Simbu |
Posted: Wed Sep 25, 2013 8:46 pm Post subject: |
|
|
 Master
Joined: 17 Jun 2011 Posts: 289 Location: Tamil Nadu, India
|
Subscribe to operational information. It will notify if message flows are Started and Stopped. Make use of these event messages to notify others. |
|
Back to top |
|
 |
mickey1691 |
Posted: Wed Sep 25, 2013 10:26 pm Post subject: |
|
|
Novice
Joined: 04 Jun 2013 Posts: 19
|
Simbu wrote: |
Subscribe to operational information. It will notify if message flows are Started and Stopped. Make use of these event messages to notify others. |
Can I use this to execute a message flow upon shutdown? |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed Sep 25, 2013 11:41 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
If the flow is running on the same broker then my guess is NO you can't.
As I understand it, when you execute an 'mqsistop' the broker stops processing any new requests and waits for any existing threads to complete before really shutting down.
If you are sending the message to another Queue Manager/Broker system then there is no reason why you can't after all, it is just a message on a queue. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
|