-
1. Re: Synchronize initialization of services/actions
tcunning Dec 13, 2012 9:46 PM (in response to dbuttery)There's the deployment.xml - you can have your ESB archive depend on an outside deployment. Maybe have an mbean do the initialization that you are looking for and then list it in the deployment.xml?
Or have a subclass for your actions that implements the initialize method?
-
2. Re: Synchronize initialization of services/actions
dbuttery Dec 14, 2012 3:46 PM (in response to tcunning)Tom,
Thanks for responding. Not quite what I was looking for though ...
I have a single ESB that presents multiple services and each of those services may have multiple actions. On deployment/startup, I'd like to have the services/actions 'wait' until one particular service/action has completed its initialization. Once that initialization is complete then the others would be free to continue with their own startup process.
Is there any way to do this? Is it possible to impose an ordering or sequence to the initialization process?
Thanks,
-Dennis
-
3. Re: Synchronize initialization of services/actions
tcunning Dec 17, 2012 1:50 PM (in response to dbuttery)Dennis,
There's probably not going to be an exactly perfect option here, but there's plenty of options you can choose from. You could separate the one particular service from your .ESB archive, and depend upon the deployment of that archive in your deployment.xml. You could look at the service pipeline interceptors which were added in ESB 4.11 - if you set it up for service instantiation, it will run at every service instantiation. You would have to have some guard around whatever code you wanted to run there to make sure it only executes one time.
--Tom
-
4. Re: Synchronize initialization of services/actions
dbuttery Dec 18, 2012 10:13 AM (in response to tcunning)Tom,
I was able to move my controlling service to its own ESB and then have my second ESB depend on the first using the deployment.xml.
Seems to work fine. Thanks!
-Dennis
-
5. Re: Synchronize initialization of services/actions
dbuttery Dec 18, 2012 4:30 PM (in response to dbuttery)Maybe spoke too soon here ...
Tom - can you shed some light on a behavior issue?
I have ESB-A and ESB-B. ESB-B has a dependancy on ESB-A. ESB-A, on initialization, runs a chunk of setup code that may take some amount of time to complete.
Here is the initialization sequence that I am seeing ...
1) ESB-A initializes and runs the setup code and successfully completes.
A few seconds later ...
2) JBoss undeploys ESB-A. ???
3) ESB-B then starts to initialize (Queues created, etc...)
4) ESB-A is then (re)deployed and initialization code runs again. ???
5) Once ESB-A finishes its initialization (again) then ESB-B runs its initialization code and completes successfully.
So... Why is ESB-A undeployed and then redeployed when ESB-B deployment starts?
Thanks,
-Dennis
-
6. Re: Synchronize initialization of services/actions
tcunning Dec 19, 2012 12:14 PM (in response to dbuttery)What happens in the initialization code? Are you touching any files within the deployment?
-
7. Re: Synchronize initialization of services/actions
dbuttery Dec 19, 2012 2:27 PM (in response to tcunning)At the moment, nothing much happens in the init code. This is in the beginning stages of development and I'm dealing with it as a POC for now. The intent of ESB-A will be to maintain a database. Currently, It only instantiates its DataSource via JNDI. ESB-B is only stubbed right now and only writes to the log.
-
8. Re: Synchronize initialization of services/actions
tcunning Jan 2, 2013 10:10 AM (in response to dbuttery)Can you post the log that shows the init sequence? I'm confused by why ESB-A would undeploy, unless the initialization code is changing something within ESB-A and forcing a hot deployment.
-
9. Re: Synchronize initialization of services/actions
dbuttery Jan 29, 2013 10:12 AM (in response to tcunning)Sorry for the response delay... I was pulled onto another project for awhile.
I think I may better understand what is happening here.
My ESBs are sharing a common connection factory definition. Each of the ESBs also have a dependancy on the CF declared in their deployment.xml.
When one ESB redeploys, the CF is unbound. This causes all of the other ESBs to shutdown due to the missing CF dependancy. As the first ESB initializes the CF is bound again and the remaining ESBs also startup and reinitialize.
So... Is there a way for ESBs to share a common CF but not incur this initialization ping-pong effect? Is there a way to allow an ESB to shutdown/restart without having the CF unbound (since other ESBs are using it)?
Thanks,
-Dennis