Commit 70ffb9bf by QIANGLU

update order

parent 2b57ca68
package com.secoo.mall.config.internals;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.ctrip.framework.apollo.spring.boot.ApolloApplicationContextInitializer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.env.EnvironmentPostProcessor;
import org.springframework.context.ApplicationContextInitializer;
......@@ -16,16 +15,15 @@ import org.springframework.util.StringUtils;
public class ApolloContextInitializer implements ApplicationContextInitializer<ConfigurableApplicationContext>,
EnvironmentPostProcessor, Ordered {
public static final int DEFAULT_ORDER = -1;
public static final int DEFAULT_ORDER = ApolloApplicationContextInitializer.DEFAULT_ORDER - 1;
private static final Logger logger = LoggerFactory.getLogger(ApolloContextInitializer.class);
@Override
public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {
String appId = environment.getProperty("spring.application.name");
if(!StringUtils.isEmpty(appId)){
System.setProperty("app.id",appId);
if (!StringUtils.isEmpty(appId)) {
System.setProperty("app.id", appId);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment