package com.clx.performance.feign;

import feign.Request;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class PerformanceClientConfiguration {



    @Bean
    public Request.Options requestOptions() {
        return new Request.Options(5000, 5000);
    }

/*    @Bean
    public ConnectionPool pool() {
        // 最大连接数、连接存活时间、存活时间单位（分钟）
        return new ConnectionPool(500, 5, TimeUnit.MINUTES);
    }

    @Bean
    public OkHttpClient okHttpClient() {
        return new OkHttpClient.Builder()
                .connectionPool(pool()) // 使用自定义连接池
                .connectTimeout(5L, TimeUnit.SECONDS) // 连接超时时间
                .readTimeout(5L, TimeUnit.SECONDS) // 读取超时时间
                .followRedirects(true) // 是否允许重定向
                .build();
    }*/
}