class SpringCloudConfigListener implements
                                      ApplicationListener<ApplicationEnvironmentPreparedEvent>,
                                      Ordered {

    private final static MapPropertySource HIGH_PRIORITY_CONFIG = new MapPropertySource(
                                                                    SofaBootConstants.SOFA_HIGH_PRIORITY_CONFIG,
                                                                    new HashMap<>());

    /**
     * config log settings
     */
    private void assemblyLogSetting(ConfigurableEnvironment environment) {
        StreamSupport.stream(environment.getPropertySources().spliterator(), false)
            .filter(propertySource -> propertySource instanceof EnumerablePropertySource)
            .map(propertySource -> Arrays
                .asList(((EnumerablePropertySource<?>) propertySource).getPropertyNames()))
                .flatMap(Collection::stream).filter(LogEnvUtils::isSofaCommonLoggingConfig)
                .forEach((key) -> HIGH_PRIORITY_CONFIG.getSource().put(key, environment.getProperty(key)));
    }

    /**
     * config required properties
     */
    private void assemblyRequireProperties(ConfigurableEnvironment environment) {
        if (StringUtils.hasText(environment.getProperty(SofaBootConstants.APP_NAME_KEY))) {
            HIGH_PRIORITY_CONFIG.getSource().put(SofaBootConstants.APP_NAME_KEY,
                environment.getProperty(SofaBootConstants.APP_NAME_KEY));
        }
    }

    @Override
    public int getOrder() {
        return ApplicationListenerOrderConstants.SOFA_BOOTSTRAP_RUN_LISTENER_ORDER;
    }

    @Override
    public void onApplicationEvent(ApplicationEnvironmentPreparedEvent event) {<FILL_FUNCTION_BODY>}
}

        ConfigurableEnvironment environment = event.getEnvironment();
        // only work in spring cloud application
        if (SofaBootEnvUtils.isSpringCloudEnvironmentEnabled(environment)) {
            if (environment.getPropertySources().contains(SofaBootConstants.SPRING_CLOUD_BOOTSTRAP)) {
                // in bootstrap application context, add high priority config
                environment.getPropertySources().addLast(HIGH_PRIORITY_CONFIG);
            } else {
                // in application context, build high priority config
                SpringApplication application = event.getSpringApplication();
                StandardEnvironment bootstrapEnvironment = new StandardEnvironment();
                StreamSupport.stream(environment.getPropertySources().spliterator(), false)
                        .filter(source -> !(source instanceof PropertySource.StubPropertySource))
                        .forEach(source -> bootstrapEnvironment.getPropertySources().addLast(source));

                List<Class<?>> sources = new ArrayList<>();
                for (Object s : application.getAllSources()) {
                    if (s instanceof Class) {
                        sources.add((Class<?>) s);
                    } else if (s instanceof String) {
                        sources.add(ClassUtils.resolveClassName((String) s, null));
                    }
                }

                SpringApplication bootstrapApplication = new SpringApplicationBuilder()
                        .profiles(environment.getActiveProfiles()).bannerMode(Banner.Mode.OFF)
                        .environment(bootstrapEnvironment).sources(sources.toArray(new Class[]{}))
                        .registerShutdownHook(false).logStartupInfo(false).web(WebApplicationType.NONE)
                        .listeners().initializers().build(event.getArgs());

                ConfigurableBootstrapContext bootstrapContext = event.getBootstrapContext();
                ApplicationEnvironmentPreparedEvent bootstrapEvent = new ApplicationEnvironmentPreparedEvent(
                        bootstrapContext, bootstrapApplication, event.getArgs(), bootstrapEnvironment);

                application.getListeners().stream()
                        .filter(listener -> listener instanceof EnvironmentPostProcessorApplicationListener)
                        .forEach(listener -> ((EnvironmentPostProcessorApplicationListener) listener)
                                .onApplicationEvent(bootstrapEvent));

                assemblyLogSetting(bootstrapEnvironment);
                assemblyRequireProperties(bootstrapEnvironment);
            }
        }
    
<no_super_class>