Hi Eric
If I'm not wrong it looks like the transports are started somewhere in the
middle of the Synapse startup. Is this observation correct? Is this on purpose?
Too me this looks like a serious error.
This is a side effect of the historical and now burned-in dependency on
Axis2.. In Synapse, the startup script actually starts Axis2, and then
again gets triggered on the startup of Axis2, for the actual Synapse
initialization
The listeners should be started only once the whole configuration process has
been successfully finished. Otherwise traffic would be accepted even though the
initialization of the configuration (proxies, sequences, endpoints and so on)
may fail.
Here is what I have read from the code (standalone deployment):
1 SynapseServer.main()
1.1
ServerConfigurationInformationFactory.createServerConfigurationInformation(args);
1.2 ServerManager.getInstance();
1.3 ServerManager.init()
1.3.1
SynapseControllerFactory.createSynapseController(configurationInformation);
1.3.2 ServerManager.doInit()
1.3.2.1 Axis2SynapseController.init()
1.3.2.1.1 Axis2SynapseController.createNewInstance()
1.3.2.1.1.1 Axis2SynapseController.createConfigurationContextFromFileSystem()
1.3.2.1.2 create and Init Listener Manager
1.3.2.1.3 start transports <--- this looks terribly wrong
1.3.2.2 Axis2SynapseController.initDefaults()
1.3.2.2.1
Axis2SynapseController.addDefaultBuildersAndFormatters(configurationContext.getAxisConfiguration());
1.3.2.2.2 Axis2SynapseController.loadMediatorExtensions();
1.3.2.2.3 Axis2SynapseController.setupDataSources();
1.4 ServerManager.start()
1.4.1 ServerManager.assertInitialized()
1.4.2 ServerManager.doInit()
1.4.3 ServerManager.doStart()
1.4.3.1 Axis2SynapseController.createSynapseConfiguration();
1.4.3.2 Axis2SynapseController.createSynapseEnvironment();
1.4.3.2.1 Axis2SynapseController.setupSynapse()
1.4.3.2.1.1 Axis2SynapseController.addServerIPAndHostEnrties();
1.4.3.2.1.2 Axis2SynapseController.setupMainMediation();
1.4.3.2.1.3 Axis2SynapseController.setupProxyServiceMediation();
1.4.3.2.1.4 Axis2SynapseController.setupEventSources();
1.4.3.2.2 SynapseConfiguration.init()
--> up to this point a lot of errors can occur resulting in "Synapse startup
failed"
Why don't we start listeners only if we reach this point without an error?
Since we have no control in the startup of Axis2, as from the pov of
Axis2, Synapse is just a module
I would propose to start the listeners immediately before the log output:
ServerManager - Ready for processing
Is there anything which will prevent this to work? If not I would be willing to
work on a patch.
I do not think this would be possible.. but please feel free to explore
any possibilities
cheers
asankha
--
Asankha C. Perera
AdroitLogic, http://adroitlogic.org
http://esbmagic.blogspot.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@synapse.apache.org
For additional commands, e-mail: dev-h...@synapse.apache.org