Author |
Message
|
deivK |
Posted: Wed Apr 11, 2012 4:57 am Post subject: Triggering execution group start |
|
|
Newbie
Joined: 11 Apr 2012 Posts: 2
|
Is there a way to trigger execuion group start?
I have this execution group that uses a cache (implemented with EhCache). I need to catch the execution group start in order to load the cache with initial data. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Apr 11, 2012 5:09 am Post subject: Re: Triggering execution group start |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
deivK wrote: |
Is there a way to trigger execuion group start? |
There's a command to start it, which you can trigger in many ways.
deivK wrote: |
I need to catch the execution group start in order to load the cache with initial data. |
Why not write code to check to see if the cache is loaded, and load it if it isn't? This would also work if an admin issued a reload command against the execution group, which doesn't restart it but will clear your cache.
You may find the many discussions on the forum regarding the care & feeding of caches within WMB useful. Not least various strategies (including the one I outline above) of dealing with an external change to the cached data. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
deivK |
Posted: Wed Apr 11, 2012 5:31 am Post subject: Re: Triggering execution group start |
|
|
Newbie
Joined: 11 Apr 2012 Posts: 2
|
Vitor wrote: |
Why not write code to check to see if the cache is loaded, and load it if it isn't? This would also work if an admin issued a reload command against the execution group, which doesn't restart it but will clear your cache.
|
We have a flow that decode certain keys using a db. The flow first looks in the cache, if a cache miss happens it loads the cache with informations from the db. But we don't want the first flow execution to load the entire cache, we want an automatic way to load the cache each time the execution group (that contains the flow) starts, in order to have the cache loaded for all flow executions.
How can we implement this? |
|
Back to top |
|
 |
McueMart |
Posted: Wed Apr 11, 2012 5:38 am Post subject: |
|
|
 Chevalier
Joined: 29 Nov 2011 Posts: 490 Location: UK...somewhere
|
A simple flow with a TimeOutNotification node set to automatic operation mode, with a very large (all the 9's!) timeout interval will run once at EG start; and then not for a very long time afterwards. You would obviously wire this up to a node ti initialize the cache.
If your cache can be invalidated/cleared at any point this obviously is a poor implementation method though. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Apr 11, 2012 7:32 am Post subject: Re: Triggering execution group start |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
deivK wrote: |
we want an automatic way to load the cache each time the execution group (that contains the flow) starts, in order to have the cache loaded for all flow executions.
How can we implement this? |
You can't, if I'm reading this correctly and you want the cache loaded by some process associated with the EG spinning up rather than a flow inside the EG. The startup process is immutable.
I again urge you to review earlier discussions on caches. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Wed Apr 11, 2012 11:50 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
Apache derby database has an in-memory feature. Using this feature, one could load his/her desired cache data into a derby in-memory database and update it at will. Therefore, his/her cache will be updated in real-time and his/her message flows will always have access to real-time cache data. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
|