synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hubert, Eric" <>
Subject startup order - correct place to start transport listeners
Date Sat, 28 Mar 2009 20:08:39 GMT
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

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() Axis2SynapseController.init() Axis2SynapseController.createNewInstance() Axis2SynapseController.createConfigurationContextFromFileSystem() create and Init Listener Manager start transports <--- this looks terribly wrong Axis2SynapseController.initDefaults() Axis2SynapseController.addDefaultBuildersAndFormatters(configurationContext.getAxisConfiguration()); Axis2SynapseController.loadMediatorExtensions(); Axis2SynapseController.setupDataSources();

1.4 ServerManager.start()
1.4.1 ServerManager.assertInitialized()
1.4.2 ServerManager.doInit()
1.4.3 ServerManager.doStart() Axis2SynapseController.createSynapseConfiguration(); Axis2SynapseController.createSynapseEnvironment(); Axis2SynapseController.setupSynapse() Axis2SynapseController.addServerIPAndHostEnrties(); Axis2SynapseController.setupMainMediation(); Axis2SynapseController.setupProxyServiceMediation(); Axis2SynapseController.setupEventSources(); 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

So far I didn't test those hypotheses, so I may be wrong. Please feel to correct my current

View raw message