Browse Source

homepage recommend

丁云鹏 1 year ago
parent
commit
48edb92133
12 changed files with 15 additions and 572 deletions
  1. 9 17
      recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/common/enums/AppTypeEnum.java
  2. 0 36
      recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/common/enums/ExceptionEnum.java
  3. 0 36
      recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/common/enums/PlatformEnum.java
  4. 0 90
      recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/common/exception/CommonException.java
  5. 0 56
      recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/common/exception/HttpServiceException.java
  6. 0 43
      recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/common/exception/TimeoutException.java
  7. 2 2
      recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/RecommendService.java
  8. 2 2
      recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/flowpool/FlowPoolService.java
  9. 1 1
      recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/recall/strategy/FlowPoolWithLevelRecallStrategy.java
  10. 1 1
      recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/recall/strategy/FlowPoolWithLevelScoreRecallStrategy.java
  11. 0 90
      recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/util/HttpClientUtil.java
  12. 0 198
      recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/util/HttpPoolClient.java

+ 9 - 17
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/common/enums/AppTypeEnum.java

@@ -15,22 +15,22 @@ public enum AppTypeEnum {
     /**
      * 票圈视频APP
      */
-    QINGQUAPP(1, "轻趣视频APP"),
+    QING_QU_APP(1, "轻趣视频APP"),
     SMILE(2, "搞笑视频"),
-    LOVEMOVIE(3, "爱电影"),
+    LOVE_MOVIE(3, "爱电影"),
     /**
      * 票圈视频小程序
      */
-    LOVELIVE(4, "爱生活"),
+    LOVE_LIVE(4, "爱生活"),
     /**
      * 长视频小程序
      */
-    LONGVIDEO(5, "长视频"),
-    SHORTVIDEO(6, "短视频"),
+    LONG_VIDEO(5, "长视频"),
+    SHORT_VIDEO(6, "短视频"),
     SURPRISE(7, "惊奇视频"),
     PC(8, "PC端"),
-    CIRCLEAPP(9, "票圈长视频APP"),
-    LONGVIDEOLITE(10, "票圈长视频lite"),
+    CIRCLE_APP(9, "票圈长视频APP"),
+    LONG_VIDEO_LITE(10, "票圈长视频lite"),
     /**
      * 票圈相册小程序
      */
@@ -39,8 +39,8 @@ public enum AppTypeEnum {
     /**
      * 极速版APP
      */
-    APPSPEED(13, "APP极速"),
-    SMALLSPEED(14, "小程序极速"),
+    APP_SPEED(13, "APP极速"),
+    SMALL_SPEED(14, "小程序极速"),
     WAN_NENG_VIDEO(17, "万能影视屋(票圈|信仰之路)"),
     LAO_HAO_KAN_VIDEO(18, "老好看视频"),
     ZUI_JING_QI(19, "票圈最惊奇"),
@@ -56,18 +56,10 @@ public enum AppTypeEnum {
         return code;
     }
 
-    public void setCode(Integer code) {
-        this.code = code;
-    }
-
     public String getDesc() {
         return desc;
     }
 
-    public void setDesc(String desc) {
-        this.desc = desc;
-    }
-
     private AppTypeEnum(Integer code, String desc) {
         this.code = code;
         this.desc = desc;

+ 0 - 36
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/common/enums/ExceptionEnum.java

@@ -1,36 +0,0 @@
-package com.tzld.piaoquan.recommend.server.common.enums;
-
-/**
- * 异常
- *
- * @author supeng
- * @date 2020/08/31
- */
-public enum ExceptionEnum {
-
-    SYSTEM_ERROR(-111, "系统错误"),
-    DATA_ERROR(-222, "数据异常,请联系管理员"),
-    USER_IS_UNVALID(2, "用户操作鉴权不通过"),
-    PARAM_ERROR(3, "参数不对"),
-    FLOW_CONTROL(-777, "接口被限流"),
-    TOKEN_NOTEXIST(-994, "访问凭证不存在"),
-	
-	;
-
-    private int code;
-    private String msg;
-
-    public int getCode() {
-        return code;
-    }
-
-
-    public String getMsg() {
-        return msg;
-    }
-
-    ExceptionEnum(int code, String msg) {
-        this.code = code;
-        this.msg = msg;
-    }
-}

+ 0 - 36
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/common/enums/PlatformEnum.java

@@ -1,36 +0,0 @@
-package com.tzld.piaoquan.recommend.server.common.enums;
-
-/**
- * 平台
- *
- * @author supeng
- * @date 2020/08/28
- */
-public enum PlatformEnum {
-    ANDROID("android", "安卓"),
-    IOS("ios", "IOS");
-
-    String value;
-    String desc;
-
-    PlatformEnum(String value, String desc) {
-        this.value = value;
-        this.desc = desc;
-    }
-
-    public String getValue() {
-        return value;
-    }
-
-    public void setValue(String value) {
-        this.value = value;
-    }
-
-    public String getDesc() {
-        return desc;
-    }
-
-    public void setDesc(String desc) {
-        this.desc = desc;
-    }
-}

+ 0 - 90
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/common/exception/CommonException.java

@@ -1,90 +0,0 @@
-package com.tzld.piaoquan.recommend.server.common.exception;
-
-import com.tzld.piaoquan.recommend.server.common.enums.ExceptionEnum;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * 异常
- *
- * @author supeng
- * @date 2020/08/28
- */
-public class CommonException extends RuntimeException {
-
-    /**
-	 * 
-	 */
-	private static final long serialVersionUID = 1L;
-	
-	private static final Logger LOGGER = LoggerFactory.getLogger(CommonException.class);
-    /**
-     * 异常
-     */
-    private ExceptionEnum exceptionEnum;
-    /**
-     * 错误码
-     */
-    private int code;
-    /**
-     * 异常信息
-     */
-    private String msg;
-    
-
-    public int getCode() {
-        return code;
-    }
-
-    public void setCode(int code) {
-        this.code = code;
-    }
-
-    public String getMsg() {
-        return msg;
-    }
-
-    public void setMsg(String msg) {
-        this.msg = msg;
-    }
-
-    public CommonException(Throwable throwable) {
-        super(throwable);
-    }
-
-    public CommonException(int code, String msg) {
-        super(msg);
-        this.code = code;
-        this.msg = msg;
-    }
-
-    public CommonException(ExceptionEnum exceptionEnum) {
-        super(exceptionEnum.getMsg());
-        this.exceptionEnum = exceptionEnum;
-        this.code = exceptionEnum.getCode();
-        this.msg = exceptionEnum.getMsg();
-    }
-
-
-    public CommonException(int code, String msg, Throwable throwable) {
-        super(msg, throwable);
-        this.code = code;
-        this.msg = msg;
-    }
-
-    public CommonException(ExceptionEnum exceptionEnum, Throwable throwable) {
-        super(exceptionEnum.getMsg(), throwable);
-        this.exceptionEnum = exceptionEnum;
-        this.code = exceptionEnum.getCode();
-        this.msg = exceptionEnum.getMsg();
-    }
-
-
-    @Override
-    public void printStackTrace() {
-        if (exceptionEnum != null) {
-            LOGGER.info("exception code = {}, msg = {}", exceptionEnum.getCode(), exceptionEnum.getMsg());
-        }
-        LOGGER.info("exception code = {}, msg = {}", code, msg);
-    }
-}

+ 0 - 56
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/common/exception/HttpServiceException.java

@@ -1,56 +0,0 @@
-package com.tzld.piaoquan.recommend.server.common.exception;
-
-/**
- *
- */
-public class HttpServiceException extends RuntimeException {
-
-    private int code;
-    private String message;
-
-    public int getCode() {
-        return code;
-    }
-
-    public void setCode(int code) {
-        this.code = code;
-    }
-
-    @Override
-    public String getMessage() {
-        return message;
-    }
-
-    public void setMessage(String message) {
-        this.message = message;
-    }
-
-    public HttpServiceException(int code, String message) {
-        this.code = code;
-        this.message = message;
-    }
-
-    public HttpServiceException(String message, int code, String message1) {
-        super(message);
-        this.code = code;
-        this.message = message1;
-    }
-
-    public HttpServiceException(String message, Throwable cause, int code, String message1) {
-        super(message, cause);
-        this.code = code;
-        this.message = message1;
-    }
-
-    public HttpServiceException(Throwable cause, int code, String message) {
-        super(cause);
-        this.code = code;
-        this.message = message;
-    }
-
-    public HttpServiceException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace, int code, String message1) {
-        super(message, cause, enableSuppression, writableStackTrace);
-        this.code = code;
-        this.message = message1;
-    }
-}

+ 0 - 43
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/common/exception/TimeoutException.java

@@ -1,43 +0,0 @@
-package com.tzld.piaoquan.recommend.server.common.exception;
-
-
-public class TimeoutException extends RuntimeException {
-
-    private String message;
-
-    @Override
-    public String getMessage() {
-        return message;
-    }
-
-    public void setMessage(String message) {
-        this.message = message;
-    }
-
-    public TimeoutException() {
-    }
-
-    public TimeoutException(String message) {
-        this.message = message;
-    }
-
-    public TimeoutException(String message, String message1) {
-        super(message);
-        this.message = message1;
-    }
-
-    public TimeoutException(String message, Throwable cause, String message1) {
-        super(message, cause);
-        this.message = message1;
-    }
-
-    public TimeoutException(Throwable cause, String message) {
-        super(cause);
-        this.message = message;
-    }
-
-    public TimeoutException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace, String message1) {
-        super(message, cause, enableSuppression, writableStackTrace);
-        this.message = message1;
-    }
-}

+ 2 - 2
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/RecommendService.java

@@ -77,8 +77,8 @@ public class RecommendService {
     @PostConstruct
     public void init() {
         ab_initial_config_map.put(AppTypeEnum.VLOG.getCode(), "095");
-        ab_initial_config_map.put(AppTypeEnum.LOVELIVE.getCode(), "144");
-        ab_initial_config_map.put(AppTypeEnum.LONGVIDEO.getCode(), "121");
+        ab_initial_config_map.put(AppTypeEnum.LOVE_LIVE.getCode(), "144");
+        ab_initial_config_map.put(AppTypeEnum.LONG_VIDEO.getCode(), "121");
         ab_initial_config_map.put(AppTypeEnum.LAO_HAO_KAN_VIDEO.getCode(), "074");
         ab_initial_config_map.put(AppTypeEnum.ZUI_JING_QI.getCode(), "069");
     }

+ 2 - 2
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/flowpool/FlowPoolService.java

@@ -34,8 +34,8 @@ public class FlowPoolService {
 
     private ExecutorService pool = ThreadPoolFactory.defaultPool();
 
-    private int[] appTypes = {VLOG.getCode(), LOVEMOVIE.getCode(), LOVELIVE.getCode(), LONGVIDEO.getCode(),
-            SHORTVIDEO.getCode(), H5.getCode(), APPSPEED.getCode(), WAN_NENG_VIDEO.getCode(),
+    private int[] appTypes = {VLOG.getCode(), LOVE_MOVIE.getCode(), LOVE_LIVE.getCode(), LONG_VIDEO.getCode(),
+            SHORT_VIDEO.getCode(), H5.getCode(), APP_SPEED.getCode(), WAN_NENG_VIDEO.getCode(),
             LAO_HAO_KAN_VIDEO.getCode(), ZUI_JING_QI.getCode(), PIAO_QUAN_VIDEO_PLUS.getCode(), JOURNEY.getCode()};
 
 

+ 1 - 1
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/recall/strategy/FlowPoolWithLevelRecallStrategy.java

@@ -78,7 +78,7 @@ public class FlowPoolWithLevelRecallStrategy extends AbstractFlowPoolWithLevelRe
         log.info("flowPoolKeyAndLevel level_p_mapping={}, random_p={}", JSONUtils.toJson(level_p_mapping), random_p);
         for (Map.Entry<String, LevelP> entry : level_p_mapping.entrySet()) {
             if (random_p >= entry.getValue().getMin()
-                    && random_p >= entry.getValue().getMax()) {
+                    && random_p <= entry.getValue().getMax()) {
                 return Pair.of(entry.getValue().getLevelKey(), entry.getKey());
             }
         }

+ 1 - 1
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/recall/strategy/FlowPoolWithLevelScoreRecallStrategy.java

@@ -78,7 +78,7 @@ public class FlowPoolWithLevelScoreRecallStrategy extends AbstractFlowPoolWithLe
         log.info("flowPoolKeyAndLevel level_p_mapping={}, random_p={}", JSONUtils.toJson(level_p_mapping), random_p);
         for (Map.Entry<String, LevelP> entry : level_p_mapping.entrySet()) {
             if (random_p >= entry.getValue().getMin()
-                    && random_p >= entry.getValue().getMax()) {
+                    && random_p <= entry.getValue().getMax()) {
                 return Pair.of(entry.getValue().getLevelKey(), entry.getKey());
             }
         }

+ 0 - 90
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/util/HttpClientUtil.java

@@ -1,90 +0,0 @@
-package com.tzld.piaoquan.recommend.server.util;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReentrantLock;
-
-/**
- * http util
- *
- * @author supeng
- */
-public class HttpClientUtil {
-
-    private static final String DEFAULT_SHARED_KEY = "DEFAULT_SHARED_KEY";
-
-    /**
-     * 链接建立的超时时间 ms
-     */
-    private static final int DEFAULT_CONNECTION_TIMEOUT = 3000;
-    /**
-     * 响应超时时间 ms
-     */
-    private static final int DEFAULT_SOCKET_TIMEOUT = 3000;
-
-    /**
-     * 每个路由的最大连接数
-     */
-    private static final int DEFAULT_DEFAULT_MAX_PER_ROUTE = 50;
-
-    /**
-     * 最大连接数
-     */
-    private static final int DEFAULT_DEFAULT_MAX_TOTAL = 200;
-
-    /**
-     * 重试次数,默认0
-     */
-    private static final int DEFAULT_RETRY_COUNT = 0;
-
-    /**
-     * 从connection pool中获得一个connection的超时时间 ms
-     */
-    private static final int DEFAULT_CONNECTION_WAIT_TIMEOUT = 300;
-
-    private static final Map<String, HttpPoolClient> CREATED_HTTP_CLIENTS = new HashMap<>();
-
-    private static final Lock LOCK = new ReentrantLock();
-
-    private HttpClientUtil() {
-    }
-
-    public static HttpPoolClient useDefault() {
-        return createCached(DEFAULT_SHARED_KEY);
-    }
-
-
-    public static HttpPoolClient createCached(String cachedKey) {
-        HttpPoolClient httpPoolClient = CREATED_HTTP_CLIENTS.get(cachedKey);
-        if (httpPoolClient != null) {
-            return httpPoolClient;
-        }
-        LOCK.lock();
-        try {
-            httpPoolClient = CREATED_HTTP_CLIENTS.get(cachedKey);
-            if (httpPoolClient == null) {
-                httpPoolClient = create(DEFAULT_CONNECTION_TIMEOUT, DEFAULT_SOCKET_TIMEOUT, DEFAULT_DEFAULT_MAX_PER_ROUTE, DEFAULT_DEFAULT_MAX_TOTAL, DEFAULT_RETRY_COUNT, DEFAULT_CONNECTION_WAIT_TIMEOUT);
-                CREATED_HTTP_CLIENTS.put(cachedKey, httpPoolClient);
-            }
-        } finally {
-            LOCK.unlock();
-        }
-        return httpPoolClient;
-    }
-
-    /**
-     * 创建httpclient
-     *
-     * @param connectTimeout        连接超时时间 ms
-     * @param socketTimeout         读超时时间(等待数据超时时间)ms
-     * @param maxPerRoute           每个路由的最大连接数
-     * @param maxTotal              最大连接数
-     * @param retryCount            重试次数
-     * @param connectionWaitTimeout 连接等待超市时间 ms
-     * @return httpclient instance
-     */
-    public static HttpPoolClient create(int connectTimeout, int socketTimeout, int maxPerRoute, int maxTotal, int retryCount, int connectionWaitTimeout) {
-        return HttpPoolClient.create(connectTimeout, socketTimeout, maxPerRoute, maxTotal, retryCount, connectionWaitTimeout);
-    }
-}

+ 0 - 198
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/util/HttpPoolClient.java

@@ -1,198 +0,0 @@
-package com.tzld.piaoquan.recommend.server.util;
-
-import com.google.common.collect.Lists;
-import com.tzld.piaoquan.recommend.server.common.exception.HttpServiceException;
-import com.tzld.piaoquan.recommend.server.common.exception.TimeoutException;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.lang3.concurrent.BasicThreadFactory;
-import org.apache.http.HttpEntity;
-import org.apache.http.HttpRequestInterceptor;
-import org.apache.http.HttpStatus;
-import org.apache.http.client.config.RequestConfig;
-import org.apache.http.client.methods.*;
-import org.apache.http.config.Registry;
-import org.apache.http.config.RegistryBuilder;
-import org.apache.http.conn.HttpClientConnectionManager;
-import org.apache.http.conn.socket.ConnectionSocketFactory;
-import org.apache.http.conn.socket.PlainConnectionSocketFactory;
-import org.apache.http.conn.ssl.NoopHostnameVerifier;
-import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
-import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.DefaultHttpRequestRetryHandler;
-import org.apache.http.impl.client.HttpClientBuilder;
-import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
-import org.apache.http.ssl.SSLContexts;
-import org.apache.http.util.EntityUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.slf4j.MDC;
-
-import javax.net.ssl.SSLContext;
-import java.net.SocketTimeoutException;
-import java.nio.charset.Charset;
-import java.security.KeyManagementException;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.util.List;
-import java.util.Optional;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-
-/**
- * http client
- * @author supeng
- */
-public class HttpPoolClient {
-
-    private static final Logger LOGGER = LoggerFactory.getLogger(HttpPoolClient.class);
-
-    private static final ScheduledExecutorService SCHEDULED_CLOSED_EXECUTOR = new ScheduledThreadPoolExecutor(1,
-            new BasicThreadFactory.Builder().namingPattern("http conn-closed-thread-%s").priority(Thread.NORM_PRIORITY).daemon(false).build(), (r, e) -> LOGGER.error(" monitor push reject task error={}", e.toString()));
-
-    private static final List<HttpClientConnectionManager> HTTP_CLIENT_CONNECTION_MANAGERS = Lists.newArrayList();
-
-    static {
-        SCHEDULED_CLOSED_EXECUTOR.schedule(() -> HTTP_CLIENT_CONNECTION_MANAGERS.forEach(HttpClientConnectionManager::closeExpiredConnections), 5, TimeUnit.SECONDS);
-    }
-
-    private CloseableHttpClient closeableHttpClient;
-
-    private HttpPoolClient(CloseableHttpClient closeableHttpClient) {
-        this.closeableHttpClient = closeableHttpClient;
-    }
-
-    private static HttpRequestInterceptor getInterceptor() {
-        HttpRequestInterceptor requestInterceptor = (request, context) -> {
-            try {
-                String missSpanId = MDC.get("missSpanId");
-                String missTraceId = MDC.get("request-id");
-                if (missTraceId != null && !"".equals(missTraceId.trim())) {
-                    request.setHeader("request-id", missTraceId);
-                }
-                if (missSpanId != null && !"".equals(missSpanId.trim())) {
-                    request.setHeader("missSpanId", missSpanId);
-                }
-            } catch (Exception e) {
-                LOGGER.error(e.getMessage(), e);
-            }
-        };
-        return requestInterceptor;
-    }
-
-
-    public Optional<String> get(String url) {
-        HttpGet httpGet = new HttpGet(url);
-        return request(httpGet);
-    }
-
-    public Optional<String> post(String url) {
-        HttpPost httpPost = new HttpPost(url);
-        return request(httpPost);
-    }
-
-
-    public Optional<String> postJson(String url, String json) {
-        HttpPost httpPost = new HttpPost(url);
-        if (StringUtils.isBlank(json)) {
-            return request(httpPost);
-        }
-        StringEntity entity = new StringEntity(json, Charset.forName("UTF-8"));
-        entity.setContentEncoding("UTF-8");
-        entity.setContentType("application/json");
-        httpPost.setEntity(entity);
-        return request(httpPost);
-    }
-
-    public Optional<String> request(HttpRequestBase request) {
-
-        if (LOGGER.isDebugEnabled()) {
-            String path = request.getURI().toString();
-            LOGGER.debug("http request url = {} ", path);
-        }
-        HttpEntity entity = null;
-        try {
-            CloseableHttpResponse response = request((HttpUriRequest) request);
-            if (response == null) {
-                throw new RuntimeException("call api exception no response");
-            }
-            entity = response.getEntity();
-            String content = null;
-            if (entity != null) {
-                content = EntityUtils.toString(entity, "UTF-8");
-            }
-            int httpStatus = response.getStatusLine().getStatusCode();
-            if (httpStatus == HttpStatus.SC_OK) {
-                return Optional.ofNullable(content);
-            }
-            String path = request.getURI().toString();
-            LOGGER.error("http call api {} fail response status {} content {}", path, httpStatus, content);
-            throw new HttpServiceException(httpStatus, content);
-        } catch (Exception e) {
-            if (e instanceof TimeoutException) {
-                throw (TimeoutException) e;
-            }
-            if (e instanceof HttpServiceException) {
-                throw (HttpServiceException) e;
-            }
-            throw new RuntimeException(e.getMessage(), e);
-        } finally {
-            if (request != null) {
-                request.abort();
-            }
-            EntityUtils.consumeQuietly(entity);
-        }
-    }
-
-
-    public CloseableHttpResponse request(HttpUriRequest request) {
-        try {
-            CloseableHttpResponse execute = closeableHttpClient.execute(request);
-            return execute;
-        } catch (Exception e) {
-            String path = request.getURI().toString();
-            if (e instanceof SocketTimeoutException) {
-                LOGGER.error(String.format("http timeout request url = %s .", path));
-                throw new TimeoutException();
-            } else {
-            }
-            throw new RuntimeException(String.format("http exception request url = %s ", path), e);
-        }
-    }
-
-    /**
-     * @param connectTimeout 连接超时时间 ms
-     * @param socketTimeout  读超时时间(等待数据超时时间)ms
-     * @param maxPerRoute    每个路由的最大连接数
-     * @param maxTotal       最大连接数
-     * @param retryCount     重试次数
-     * @return httpclient instance
-     */
-    protected static HttpPoolClient create(int connectTimeout, int socketTimeout, int maxPerRoute, int maxTotal, int retryCount, int connectionWaitTimeout) {
-        try {
-            RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(connectTimeout).setSocketTimeout(socketTimeout).setConnectionRequestTimeout(connectionWaitTimeout).build();
-            CloseableHttpClient client = HttpClientBuilder.create()
-                    .setDefaultRequestConfig(requestConfig)
-                    .setConnectionManager(createConnectionManager(maxPerRoute, maxTotal))
-                    .setRetryHandler(new DefaultHttpRequestRetryHandler(retryCount, false)).addInterceptorFirst(getInterceptor()).build();
-            return new HttpPoolClient(client);
-        } catch (Throwable e) {
-            LOGGER.error("create HttpPoolClient exception", e);
-            throw new RuntimeException("create HttpPoolClient exception");
-        }
-    }
-
-    private static PoolingHttpClientConnectionManager createConnectionManager(int maxPerRoute, int maxTotal) throws NoSuchAlgorithmException, KeyStoreException, KeyManagementException {
-        SSLContext sslContext = SSLContexts.custom().loadTrustMaterial((chain, authType) -> true).build();
-        Registry<ConnectionSocketFactory> registry = RegistryBuilder.<ConnectionSocketFactory>create()
-                .register("http", PlainConnectionSocketFactory.getSocketFactory())
-                .register("https", new SSLConnectionSocketFactory(sslContext, NoopHostnameVerifier.INSTANCE)).build();
-        PoolingHttpClientConnectionManager cm = new PoolingHttpClientConnectionManager(registry);
-        cm.setDefaultMaxPerRoute(maxPerRoute);
-        cm.setMaxTotal(maxTotal);
-        HTTP_CLIENT_CONNECTION_MANAGERS.add(cm);
-        return cm;
-    }
-
-}