Author |
Message
|
LH33 |
Posted: Tue Mar 18, 2003 9:15 am Post subject: Conditionally executing a Message Flow?? |
|
|
Master
Joined: 21 Nov 2002 Posts: 200
|
HI!
I have to create a message flow that retrieves messages from a queue and logs them into a database. I want to know if there is a parameter or setting or some configuration to be able to turn the flow on or off depending on whether we want to log the messages or stop logging them for a period of time.
Thanks in advance for any help you can provide!!
LisaB |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Mar 18, 2003 9:47 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
There isn't anything predefined to do this. You will have to code your message flow (or something else) to identify when to enable logging and when to disable it.
The simplest way to skip logging is put in a filter node. The true path goes to the part that does the db insert. The false path is unconnected - the message will then get discarded.
The next option is to get-disable the queue your message flow is reading from. There are a number of options for doing this from inside WMQI - although you probably want to do it from a separate "control" message flow so that you can enable it again without having to do it manually.
Or you could use the command line tools in Support Pack IC01 to script removing and then re-assigning your message flow to your execution groups. |
|
Back to top |
|
 |
LH33 |
Posted: Tue Mar 18, 2003 10:50 am Post subject: |
|
|
Master
Joined: 21 Nov 2002 Posts: 200
|
So if I do a filter node, then I would have to modify the flow every time I need to turn logging on or off. I was hoping there was a way to do it without modifying the flow each time. Based on an earlier response - is it correct that there are no parameters in WMQI to allow for this?
Thanks, LisaB |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Mar 18, 2003 12:24 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
No, you wouldn't have to modify the flow each time.
Have the filter node test against a property of the message - or against any value you can compute in ESQL. Then you can control it on a per message basis. Or have it compared against a value pulled out of a database.
For instance, you could compare against the current time (returned by an ESQL function) to disable writing to the datbase when your database is in a maintenance window.
Again, this is all assuming that you want something to happen 'automatically', and you don't want to manually use the Operations tab to stop your flow. |
|
Back to top |
|
 |
granthmuk |
Posted: Wed Mar 19, 2003 7:35 am Post subject: PubSub may offer the flexibility you require. |
|
|
 Apprentice
Joined: 16 May 2001 Posts: 38 Location: Edinburgh, Scotland
|
Perhaps you could use a PubSub mechanism to switch your logging on and off. You could subscribe on behalf of your logging flow when you want to log and unsubscribe when you don't want to log. |
|
Back to top |
|
 |
LH33 |
Posted: Wed Mar 19, 2003 7:56 am Post subject: |
|
|
Master
Joined: 21 Nov 2002 Posts: 200
|
Thanks for the PubSub suggestion! Do you know how to do that or where I could find documentation on how to do that?
Thanks, LisaB |
|
Back to top |
|
 |
granthmuk |
Posted: Wed Mar 19, 2003 8:02 am Post subject: |
|
|
 Apprentice
Joined: 16 May 2001 Posts: 38 Location: Edinburgh, Scotland
|
|
Back to top |
|
 |
|