isRemoteConfiguration = configuration.getRemoteConfiguration();
if (isRemoteConfiguration) {
String label = configuration.getLabel();
log.info(“[{}] Initializing gateway”, configuration.getLabel());
TenantServiceRegistry tenantServiceRegistry = new TenantServiceRegistry();
GatewayService service = null;
try {
// isRemoteConfiguration为true时,会响应服务端返回的配置信息
service = getGatewayService(configuration, c -> tenantServiceRegistry.updateExtensionConfiguration©);
tenantServiceRegistry.setService(service);
gateways.put(label, tenantServiceRegistry);
} catch (Exception e) {
log.info("[{}] Failed to initialize the service ", label, e);
try {
if (service != null) {
service.destroy();
}
} catch (Exception exc) {
log.info("[{}] Failed to stop the service ", lab