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

org.zodiac.autoconfigure.internal.ReactiveInternalAutoConfiguration Maven / Gradle / Ivy

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

import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
import org.springframework.context.annotation.Bean;
import org.zodiac.autoconfigure.bootstrap.condition.ConditionalOnAppDiscoveryEnabled;
import org.zodiac.core.application.AppContext;
import org.zodiac.core.bootstrap.discovery.ReactiveAppDiscoveryClient;
import org.zodiac.core.internal.http.ReactiveAppInternalHttpClient;

@SpringBootConfiguration
@ConditionalOnAppDiscoveryEnabled
@ConditionalOnWebApplication(type = Type.REACTIVE)
@ConditionalOnClass(value = {org.springframework.web.client.RestTemplate.class})
public class ReactiveInternalAutoConfiguration {

    public ReactiveInternalAutoConfiguration() {
        super();
    }

    @Bean
    @ConditionalOnMissingBean
    protected ReactiveAppInternalHttpClient internalHttpClient(ReactiveAppDiscoveryClient discoveryClient, AppContext appContext,
        ObjectProvider restTemplateProvider) {
        return new ReactiveAppInternalHttpClient(discoveryClient, appContext, restTemplateProvider.getIfAvailable());
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy