org.zodiac.autoconfigure.feign.FeignContextAutoConfiguration Maven / Gradle / Ivy
package org.zodiac.autoconfigure.feign;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.zodiac.autoconfigure.feign.condition.ConditionalOnFeignConsumerEnabled;
import org.zodiac.feign.core.constants.FeignSystemPropertiesConstants;
/***
* Feign context auto configuration(consumer/client|provider/server).
*
*/
@SpringBootConfiguration
@ConditionalOnFeignConsumerEnabled
@ConditionalOnClass(value = {feign.Client.class, org.zodiac.feign.core.FeignConsumerClientProvider.class})
@ImportAutoConfiguration(value = {ServletFeignContextConfiguration.class, ReactiveFeignContextConfiguration.class, OkHttpFeignConsumerConfiguration.class, NettyFeignConsumerConfiguration.class})
public class FeignContextAutoConfiguration {
public FeignContextAutoConfiguration() {
super();
}
@Bean
@ConditionalOnMissingBean
@ConfigurationProperties(prefix = FeignSystemPropertiesConstants.FEIGN_CLIENT_CONSUMER_PREFIX, ignoreInvalidFields = true)
protected FeignConsumerProperties feignConsumerProperties() {
return new FeignConsumerProperties();
}
}