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

org.zodiac.autoconfigure.feign.Http2ClientFeignConsumerConfiguration Maven / Gradle / Ivy

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

import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.zodiac.autoconfigure.feign.condition.ConditionalOnFeignConsumerEnabled;
import org.zodiac.autoconfigure.feign.condition.ConditionalOnFeignHttp2ClientEnabled;
import org.zodiac.feign.core.constants.FeignConstants;
import org.zodiac.feign.core.constants.FeignConsumerConstants;
import org.zodiac.feign.core.constants.FeignSystemPropertiesConstants;

@SpringBootConfiguration
@ConditionalOnFeignConsumerEnabled
@ConditionalOnFeignHttp2ClientEnabled
@ConditionalOnClass(value = {feign.Feign.class, feign.http2client.Http2Client.class, java.net.http.HttpClient.class})
@ConditionalOnExpression(value = "'" + FeignConstants.CLIENT_PROVIDER_HTTP2CLIENT + "'.equalsIgnoreCase('${" + FeignSystemPropertiesConstants.FEIGN_CLIENT_CONSUMER_PROVIDER + ":" + FeignConstants.CLIENT_PROVIDER_HTTP2CLIENT + "}')")
class Http2ClientFeignConsumerConfiguration extends org.zodiac.feign.http2client.config.Http2ClientFeignConsumerConfigurer {

    public Http2ClientFeignConsumerConfiguration(FeignConsumerProperties feignConsumerProperties) {
        super(feignConsumerProperties);
    }

    @Bean
    @ConditionalOnMissingBean
    @Override
    protected java.net.http.HttpClient httpClient() {
        return super.httpClient();
    }

    @Bean(name = FeignConsumerConstants.BEAN_FEIGN_CLIENT)
    @ConditionalOnMissingBean
    @Override
    protected feign.Client http2ClientFeignClient(java.net.http.HttpClient httpClient) {
        return super.http2ClientFeignClient(httpClient);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy