All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.zodiac.autoconfigure.apollo.ApolloClientAutoConfiguration Maven / Gradle / Ivy

There is a newer version: 1.6.8
Show newest version
package org.zodiac.autoconfigure.apollo;

import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.zodiac.apollo.sdk.constants.ApolloSystemPropertiesConstants;
import org.zodiac.autoconfigure.apollo.condition.ConditionalOnApolloEnabled;

@SpringBootConfiguration
@ConditionalOnApolloEnabled
//@EnableConfigurationProperties(value = {ApolloClientProperties.class})
@AutoConfigureBefore(name = {"com.ctrip.framework.apollo.spring.boot.ApolloAutoConfiguration"})
@ConditionalOnClass(name = {"com.ctrip.framework.apollo.ConfigService", "com.ctrip.framework.apollo.Apollo"})
@ConditionalOnProperty(value = ApolloSystemPropertiesConstants.Zodiac.APOLLO_BOOTSTRAP_ENABLED, havingValue = "true")
public class ApolloClientAutoConfiguration {

    public ApolloClientAutoConfiguration() {
        super();
    }

    @Bean
    @ConditionalOnMissingBean
    @ConfigurationProperties(prefix = ApolloSystemPropertiesConstants.APOLLO_PREFIX, ignoreInvalidFields = true)
    protected ApolloClientProperties ApolloClientProperties() {
        return new ApolloClientProperties();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy