Hi all, while working on patch to make direct use of the existing MBeans in Synapse I was wondering about the current order of actions during Synapse startup.
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. 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? 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. So far I didn't test those hypotheses, so I may be wrong. Please feel to correct my current understanding! Regards, Eric