This is an automated email from the ASF dual-hosted git repository.

kriszu pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git


The following commit(s) were added to refs/heads/dev by this push:
     new 510ca330e [improve] Upgrade httpclient version to 5.1 (#2733)
510ca330e is described below

commit 510ca330ee7f9b7e361187cb471f651f1744caa3
Author: benjobs <[email protected]>
AuthorDate: Mon May 8 22:36:33 2023 +0800

    [improve] Upgrade httpclient version to 5.1 (#2733)
    
    Co-authored-by: benjobs <[email protected]>
---
 pom.xml                                            |  18 ++-
 streampark-common/pom.xml                          |   4 +-
 .../streampark/common/util/HttpClientUtils.scala   | 130 +++++++--------------
 .../apache/streampark/common/util/YarnUtils.scala  |  22 +---
 .../streampark-console-service/pom.xml             |  11 +-
 .../console/base/config/OpenapiConfig.java         |   2 +-
 .../streampark/console/base/util/GZipUtils.java    |   4 +-
 .../console/core/entity/FlinkCluster.java          |  14 ++-
 .../alert/impl/DingTalkAlertNotifyServiceImpl.java |   4 +-
 .../alert/impl/LarkAlertNotifyServiceImpl.java     |   5 +-
 .../core/service/impl/ProjectServiceImpl.java      |   2 +-
 .../console/core/task/FlinkRESTAPIWatcher.java     |   5 +-
 .../core/service/ApplicationServiceTest.java       |   2 +-
 .../streampark-flink-connector/pom.xml             |   8 ++
 .../streampark-flink-connector-doris/pom.xml       |   5 +
 .../pom.xml                                        |   5 +
 .../streampark-flink-connector-http/pom.xml        |   5 +
 streampark-flink/streampark-flink-packer/pom.xml   |   6 +
 18 files changed, 122 insertions(+), 130 deletions(-)

diff --git a/pom.xml b/pom.xml
index e6eeda369..b17a6820a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -136,7 +136,7 @@
         
<build-helper-maven-plugin.version>3.3.0</build-helper-maven-plugin.version>
         
<streampark.shaded.package>org.apache.streampark.shaded</streampark.shaded.package>
         
<flink.table.uber.artifact.id>flink-table-uber_${scala.binary.version}</flink.table.uber.artifact.id>
-        <httpclient.version>4.5.13</httpclient.version>
+        <httpclient5.version>5.1</httpclient5.version>
         <lombok.version>1.18.24</lombok.version>
         <jupiter.version>5.9.1</jupiter.version>
         <mockito.version>3.4.6</mockito.version>
@@ -193,6 +193,10 @@
                         <groupId>com.google.code.findbugs</groupId>
                         <artifactId>jsr305</artifactId>
                     </exclusion>
+                    <exclusion>
+                        <groupId>com.google.errorprone</groupId>
+                        <artifactId>error_prone_annotations</artifactId>
+                    </exclusion>
                 </exclusions>
             </dependency>
 
@@ -306,9 +310,15 @@
             </dependency>
 
             <dependency>
-                <groupId>org.apache.httpcomponents</groupId>
-                <artifactId>httpclient</artifactId>
-                <version>${httpclient.version}</version>
+                <groupId>org.apache.httpcomponents.client5</groupId>
+                <artifactId>httpclient5</artifactId>
+                <version>${httpclient5.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.apache.httpcomponents.client5</groupId>
+                <artifactId>httpclient5-fluent</artifactId>
+                <version>${httpclient5.version}</version>
             </dependency>
 
             <dependency>
diff --git a/streampark-common/pom.xml b/streampark-common/pom.xml
index 7b78f769f..6004b101e 100644
--- a/streampark-common/pom.xml
+++ b/streampark-common/pom.xml
@@ -104,8 +104,8 @@
         </dependency>
 
         <dependency>
-            <groupId>org.apache.httpcomponents</groupId>
-            <artifactId>httpclient</artifactId>
+            <groupId>org.apache.httpcomponents.client5</groupId>
+            <artifactId>httpclient5</artifactId>
         </dependency>
 
         <dependency>
diff --git 
a/streampark-common/src/main/scala/org/apache/streampark/common/util/HttpClientUtils.scala
 
b/streampark-common/src/main/scala/org/apache/streampark/common/util/HttpClientUtils.scala
index 5e2e7d5c5..34247a510 100644
--- 
a/streampark-common/src/main/scala/org/apache/streampark/common/util/HttpClientUtils.scala
+++ 
b/streampark-common/src/main/scala/org/apache/streampark/common/util/HttpClientUtils.scala
@@ -16,23 +16,22 @@
  */
 package org.apache.streampark.common.util
 
-import org.apache.http.NameValuePair
-import org.apache.http.auth.{AuthSchemeProvider, AuthScope, Credentials}
-import org.apache.http.client.config.{AuthSchemes, RequestConfig}
-import org.apache.http.client.entity.UrlEncodedFormEntity
-import org.apache.http.client.methods._
-import org.apache.http.client.utils.URIBuilder
-import org.apache.http.config.RegistryBuilder
-import org.apache.http.entity.StringEntity
-import org.apache.http.impl.auth.SPNegoSchemeFactory
-import org.apache.http.impl.client.{BasicCredentialsProvider, 
CloseableHttpClient, HttpClientBuilder, HttpClients}
-import org.apache.http.impl.conn.PoolingHttpClientConnectionManager
-import org.apache.http.message.BasicNameValuePair
-import org.apache.http.util.EntityUtils
+import org.apache.hc.client5.http.auth.{AuthSchemeFactory, AuthScope, 
Credentials, StandardAuthScheme}
+import org.apache.hc.client5.http.classic.methods.{HttpGet, HttpPost, 
HttpUriRequestBase}
+import org.apache.hc.client5.http.config.RequestConfig
+import org.apache.hc.client5.http.entity.UrlEncodedFormEntity
+import org.apache.hc.client5.http.impl.auth.{BasicCredentialsProvider, 
SPNegoSchemeFactory}
+import org.apache.hc.client5.http.impl.classic.{CloseableHttpClient, 
HttpClientBuilder, HttpClients}
+import org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager
+import org.apache.hc.core5.http.NameValuePair
+import org.apache.hc.core5.http.config.RegistryBuilder
+import org.apache.hc.core5.http.io.entity.EntityUtils
+import org.apache.hc.core5.http.message.BasicNameValuePair
+import org.apache.hc.core5.net.URIBuilder
 
 import java.nio.charset.{Charset, StandardCharsets}
 import java.security.Principal
-import java.util
+import java.util.{List => JavaList, Map => JavaMap}
 
 import scala.collection.JavaConversions._
 
@@ -52,8 +51,9 @@ object HttpClientUtils {
 
   private[this] def getHttpGet(
       url: String,
-      params: util.Map[String, AnyRef] = null,
+      params: JavaMap[String, AnyRef] = null,
       config: RequestConfig = null): HttpGet = {
+
     val httpGet = params match {
       case null => new HttpGet(url)
       case _ =>
@@ -78,15 +78,15 @@ object HttpClientUtils {
   def httpGetRequest(
       url: String,
       config: RequestConfig,
-      params: util.Map[String, AnyRef]): String = {
+      params: JavaMap[String, AnyRef]): String = {
     getHttpResult(getHttpGet(url, params, config))
   }
 
   def httpGetRequest(
       url: String,
       config: RequestConfig,
-      headers: util.Map[String, AnyRef],
-      params: util.Map[String, AnyRef]): String = {
+      headers: JavaMap[String, AnyRef],
+      params: JavaMap[String, AnyRef]): String = {
     val httpGet = getHttpGet(url, params, config)
     headers.entrySet.foreach(p => httpGet.addHeader(p.getKey, 
String.valueOf(p.getValue)))
     getHttpResult(httpGet)
@@ -97,83 +97,47 @@ object HttpClientUtils {
     getHttpResult(httpPost)
   }
 
-  def httpPatchRequest(url: String): String = {
-    val httpPatch = new HttpPatch(url)
-    getHttpResult(httpPatch)
-  }
-
-  def httpPostRequest(url: String, params: util.Map[String, AnyRef]): String = 
{
+  def httpPostRequest(url: String, params: JavaMap[String, AnyRef]): String = {
     val httpPost = new HttpPost(url)
     httpPost.setEntity(new 
UrlEncodedFormEntity(paramsToNameValuePairs(params), defaultChart))
     getHttpResult(httpPost)
   }
 
-  def httpPatchRequest(url: String, params: util.Map[String, AnyRef]): String 
= {
-    val httpPatch = new HttpPatch(url)
-    httpPatch.setEntity(new 
UrlEncodedFormEntity(paramsToNameValuePairs(params), defaultChart))
-    getHttpResult(httpPatch)
-  }
-
-  def httpPostRequest(url: String, params: String): String = httpRequest(new 
HttpPost(url), params)
-
-  def httpPatchRequest(url: String, params: String): String =
-    httpRequest(new HttpPatch(url), params)
-
   def httpPostRequest(
       url: String,
-      params: util.Map[String, AnyRef],
-      headers: util.Map[String, AnyRef] = Map.empty[String, AnyRef]): String = 
{
+      params: JavaMap[String, AnyRef],
+      headers: JavaMap[String, AnyRef] = Map.empty[String, AnyRef]): String = {
     httpRequest(new HttpPost(url), headers, params)
   }
 
-  def httpPatchRequest(
-      url: String,
-      params: util.Map[String, AnyRef],
-      headers: util.Map[String, AnyRef] = Map.empty[String, AnyRef]): String = 
{
-    httpRequest(new HttpPatch(url), headers, params)
-  }
-
   private[this] def httpRequest(
-      httpEntity: HttpEntityEnclosingRequestBase,
-      params: String): String = {
-    val entity = new StringEntity(params, defaultChart)
-    entity.setContentEncoding("UTF-8")
-    entity.setContentType("application/json")
-    httpEntity.setEntity(entity)
-    getHttpResult(httpEntity)
-  }
-
-  private[this] def httpRequest(
-      httpPatch: HttpEntityEnclosingRequestBase,
-      headers: util.Map[String, AnyRef],
-      params: util.Map[String, AnyRef]) = {
-    headers.entrySet.foreach(p => httpPatch.addHeader(p.getKey, 
String.valueOf(p.getValue)))
-    httpPatch.setEntity(new 
UrlEncodedFormEntity(paramsToNameValuePairs(params), defaultChart))
-    getHttpResult(httpPatch)
+      httpUri: HttpUriRequestBase,
+      headers: JavaMap[String, AnyRef],
+      params: JavaMap[String, AnyRef]) = {
+    headers.entrySet.foreach(p => httpUri.addHeader(p.getKey, 
String.valueOf(p.getValue)))
+    httpUri.setEntity(new UrlEncodedFormEntity(paramsToNameValuePairs(params), 
defaultChart))
+    getHttpResult(httpUri)
   }
 
   private[this] def paramsToNameValuePairs(
-      params: util.Map[String, AnyRef]): util.List[NameValuePair] = {
-    val pairs = new util.ArrayList[NameValuePair]
-    params.entrySet.foreach(
-      p => pairs.add(new BasicNameValuePair(p.getKey, 
String.valueOf(p.getValue))))
-    pairs
+      params: JavaMap[String, AnyRef]): JavaList[NameValuePair] = {
+    params.entrySet.map(p => new BasicNameValuePair(p.getKey, 
p.getValue.toString)).toList
   }
 
   def httpAuthGetRequest(url: String, config: RequestConfig): String = {
     def getHttpAuthClient: CloseableHttpClient = {
       val credentialsProvider = new BasicCredentialsProvider
-      credentialsProvider.setCredentials(
-        new AuthScope(null, -1, null),
-        new Credentials {
-          override def getUserPrincipal: Principal = null
 
-          override def getPassword: String = null
-        })
+      val credentials = new Credentials() {
+        def getPassword: Array[Char] = null
+        def getUserPrincipal: Principal = null
+      }
+
+      credentialsProvider.setCredentials(new AuthScope(null, -1), credentials)
 
       val authSchemeRegistry = RegistryBuilder
-        .create[AuthSchemeProvider]
-        .register(AuthSchemes.SPNEGO, new SPNegoSchemeFactory(true))
+        .create[AuthSchemeFactory]
+        .register(StandardAuthScheme.SPNEGO, SPNegoSchemeFactory.DEFAULT)
         .build
 
       HttpClientBuilder
@@ -189,19 +153,15 @@ object HttpClientUtils {
 
   /** process http request */
   private[this] def getHttpResult(
-      request: HttpRequestBase,
+      request: HttpUriRequestBase,
       httpClient: CloseableHttpClient = getHttpClient): String = {
-    try {
-      val response = httpClient.execute(request)
-      val entity = response.getEntity
-      if (entity != null) {
-        val result = EntityUtils.toString(entity)
-        response.close()
-        result
-      } else null
-    } catch {
-      case e: Exception => throw e
-    }
+    val response = httpClient.execute(request)
+    val entity = response.getEntity
+    if (entity != null) {
+      val result = EntityUtils.toString(entity)
+      response.close()
+      result
+    } else null
   }
 
 }
diff --git 
a/streampark-common/src/main/scala/org/apache/streampark/common/util/YarnUtils.scala
 
b/streampark-common/src/main/scala/org/apache/streampark/common/util/YarnUtils.scala
index d9058de3d..c93034348 100644
--- 
a/streampark-common/src/main/scala/org/apache/streampark/common/util/YarnUtils.scala
+++ 
b/streampark-common/src/main/scala/org/apache/streampark/common/util/YarnUtils.scala
@@ -25,15 +25,13 @@ import org.apache.hadoop.yarn.api.records._
 import org.apache.hadoop.yarn.api.records.YarnApplicationState._
 import org.apache.hadoop.yarn.conf.{HAUtil, YarnConfiguration}
 import org.apache.hadoop.yarn.util.{ConverterUtils, RMHAUtils}
-import org.apache.http.client.config.RequestConfig
-import org.apache.http.client.methods.HttpGet
-import org.apache.http.client.protocol.HttpClientContext
-import org.apache.http.impl.client.HttpClients
+import org.apache.hc.client5.http.config.RequestConfig
 
 import java.net.InetAddress
 import java.security.PrivilegedExceptionAction
 import java.util
 import java.util.{HashMap => JavaHashMap, List => JavaList}
+import java.util.concurrent.TimeUnit
 
 import scala.collection.JavaConversions._
 import scala.collection.mutable.ArrayBuffer
@@ -230,19 +228,11 @@ object YarnUtils extends Logger {
   }
 
   private[this] def httpTestYarnRMUrl(url: String, timeout: Int): String = {
-    val httpClient = HttpClients.createDefault();
-    val context = HttpClientContext.create()
-    val httpGet = new HttpGet(url)
-    val requestConfig = RequestConfig
+    val config = RequestConfig
       .custom()
-      .setSocketTimeout(timeout)
-      .setConnectTimeout(timeout)
+      .setConnectTimeout(timeout, TimeUnit.MILLISECONDS)
       .build()
-    httpGet.setConfig(requestConfig)
-    Try(httpClient.execute(httpGet, context)) match {
-      case Success(_) => context.getTargetHost.toString
-      case _ => null
-    }
+    HttpClientUtils.httpGetRequest(url, config)
   }
 
   def getYarnAppTrackingUrl(applicationId: ApplicationId): String =
@@ -258,7 +248,7 @@ object YarnUtils extends Logger {
 
     def request(url: String): String = {
       logDebug("request url is " + url);
-      val config = RequestConfig.custom.setConnectTimeout(5000).build
+      val config = RequestConfig.custom.setConnectTimeout(5000, 
TimeUnit.MILLISECONDS).build
       if (hasYarnHttpKerberosAuth) {
         HadoopUtils
           .getUgi()
diff --git a/streampark-console/streampark-console-service/pom.xml 
b/streampark-console/streampark-console-service/pom.xml
index 215e10392..c440606da 100644
--- a/streampark-console/streampark-console-service/pom.xml
+++ b/streampark-console/streampark-console-service/pom.xml
@@ -114,11 +114,6 @@
             <version>${commons-compress.version}</version>
         </dependency>
 
-        <dependency>
-            <groupId>commons-net</groupId>
-            <artifactId>commons-net</artifactId>
-        </dependency>
-
         <dependency>
             <groupId>javax.mail</groupId>
             <artifactId>mail</artifactId>
@@ -182,6 +177,12 @@
             <groupId>org.apache.shiro</groupId>
             <artifactId>shiro-spring</artifactId>
             <version>${shiro.version}</version>
+            <exclusions>
+                <exclusion>
+                    <artifactId>commons-beanutils</artifactId>
+                    <groupId>commons-beanutils</groupId>
+                </exclusion>
+            </exclusions>
         </dependency>
 
         <!-- spring cache -->
diff --git 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/base/config/OpenapiConfig.java
 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/base/config/OpenapiConfig.java
index 39f0a48da..aa5ec0185 100644
--- 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/base/config/OpenapiConfig.java
+++ 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/base/config/OpenapiConfig.java
@@ -17,7 +17,7 @@
 
 package org.apache.streampark.console.base.config;
 
-import org.apache.http.HttpHeaders;
+import org.apache.hc.core5.http.HttpHeaders;
 
 import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
 import io.swagger.v3.oas.models.Components;
diff --git 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/base/util/GZipUtils.java
 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/base/util/GZipUtils.java
index 77db81c3d..0955efacb 100644
--- 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/base/util/GZipUtils.java
+++ 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/base/util/GZipUtils.java
@@ -39,7 +39,7 @@ public final class GZipUtils {
    * @param tarZipSource source dir
    * @param targetDir target dir
    */
-  public static File decompress(String tarZipSource, String targetDir) {
+  public static void deCompress(String tarZipSource, String targetDir) {
     File unFile = null;
     // tar compress format
     ArchiveStreamFactory archiveStreamFactory = new ArchiveStreamFactory();
@@ -74,8 +74,6 @@ public final class GZipUtils {
     } catch (Exception e) {
       log.error(e.getMessage(), e);
     }
-
-    return unFile;
   }
 
   /**
diff --git 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkCluster.java
 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkCluster.java
index e7bacde14..7d20f0976 100644
--- 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkCluster.java
+++ 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkCluster.java
@@ -32,7 +32,7 @@ import 
org.apache.streampark.console.core.utils.YarnQueueLabelExpression;
 
 import org.apache.commons.lang3.StringUtils;
 import org.apache.flink.configuration.CoreOptions;
-import org.apache.http.client.config.RequestConfig;
+import org.apache.hc.client5.http.config.RequestConfig;
 
 import com.baomidou.mybatisplus.annotation.FieldStrategy;
 import com.baomidou.mybatisplus.annotation.IdType;
@@ -52,6 +52,7 @@ import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.TimeUnit;
 
 @Data
 @TableName("t_flink_cluster")
@@ -135,7 +136,8 @@ public class FlinkCluster implements Serializable {
   public URI getRemoteURI() {
     try {
       HttpClientUtils.httpGetRequest(
-          this.address, RequestConfig.custom().setSocketTimeout(2000).build());
+          this.address,
+          RequestConfig.custom().setConnectTimeout(2000, 
TimeUnit.MILLISECONDS).build());
       return new URI(address);
     } catch (Exception ignored) {
       //
@@ -157,7 +159,8 @@ public class FlinkCluster implements Serializable {
         String restUrl = address + "/overview";
         String result =
             HttpClientUtils.httpGetRequest(
-                restUrl, 
RequestConfig.custom().setConnectTimeout(2000).build());
+                restUrl,
+                RequestConfig.custom().setConnectTimeout(2000, 
TimeUnit.MILLISECONDS).build());
         JacksonUtils.read(result, Overview.class);
         return true;
       } catch (Exception ignored) {
@@ -169,7 +172,8 @@ public class FlinkCluster implements Serializable {
         String restUrl = YarnUtils.getRMWebAppURL() + "/proxy/" + 
this.clusterId + "/overview";
         String result =
             HttpClientUtils.httpGetRequest(
-                restUrl, 
RequestConfig.custom().setConnectTimeout(2000).build());
+                restUrl,
+                RequestConfig.custom().setConnectTimeout(2000, 
TimeUnit.MILLISECONDS).build());
         JacksonUtils.read(result, Overview.class);
         return true;
       } catch (Exception ignored) {
@@ -185,7 +189,7 @@ public class FlinkCluster implements Serializable {
     String restUrl = this.address + "/jobmanager/config";
     String json =
         HttpClientUtils.httpGetRequest(
-            restUrl, RequestConfig.custom().setConnectTimeout(2000).build());
+            restUrl, RequestConfig.custom().setConnectTimeout(2000, 
TimeUnit.MILLISECONDS).build());
     if (StringUtils.isEmpty(json)) {
       return Collections.emptyMap();
     }
diff --git 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/alert/impl/DingTalkAlertNotifyServiceImpl.java
 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/alert/impl/DingTalkAlertNotifyServiceImpl.java
index 298ee29aa..7d0e2efa5 100644
--- 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/alert/impl/DingTalkAlertNotifyServiceImpl.java
+++ 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/alert/impl/DingTalkAlertNotifyServiceImpl.java
@@ -26,7 +26,6 @@ import org.apache.streampark.console.core.bean.RobotResponse;
 import org.apache.streampark.console.core.service.alert.AlertNotifyService;
 
 import org.apache.commons.lang3.BooleanUtils;
-import org.apache.commons.net.util.Base64;
 
 import freemarker.template.Template;
 import lombok.extern.slf4j.Slf4j;
@@ -45,6 +44,7 @@ import javax.crypto.spec.SecretKeySpec;
 import java.net.URLEncoder;
 import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
+import java.util.Base64;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -187,7 +187,7 @@ public class DingTalkAlertNotifyServiceImpl implements 
AlertNotifyService {
       Mac mac = Mac.getInstance("HmacSHA256");
       mac.init(new SecretKeySpec(secret.getBytes(StandardCharsets.UTF_8), 
"HmacSHA256"));
       byte[] signData = 
mac.doFinal(stringToSign.getBytes(StandardCharsets.UTF_8));
-      String sign = URLEncoder.encode(new 
String(Base64.encodeBase64(signData)), "UTF-8");
+      String sign = URLEncoder.encode(new 
String(Base64.getEncoder().encode(signData)), "UTF-8");
       if (log.isDebugEnabled()) {
         log.debug("Calculate the signature success, sign:{}", sign);
       }
diff --git 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/alert/impl/LarkAlertNotifyServiceImpl.java
 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/alert/impl/LarkAlertNotifyServiceImpl.java
index 971c23b6d..2eae49b2c 100644
--- 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/alert/impl/LarkAlertNotifyServiceImpl.java
+++ 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/alert/impl/LarkAlertNotifyServiceImpl.java
@@ -25,8 +25,6 @@ import 
org.apache.streampark.console.core.bean.AlertLarkRobotResponse;
 import org.apache.streampark.console.core.bean.AlertTemplate;
 import org.apache.streampark.console.core.service.alert.AlertNotifyService;
 
-import org.apache.commons.net.util.Base64;
-
 import com.fasterxml.jackson.core.type.TypeReference;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import freemarker.template.Template;
@@ -44,6 +42,7 @@ import javax.crypto.Mac;
 import javax.crypto.spec.SecretKeySpec;
 
 import java.nio.charset.StandardCharsets;
+import java.util.Base64;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -159,7 +158,7 @@ public class LarkAlertNotifyServiceImpl implements 
AlertNotifyService {
       Mac mac = Mac.getInstance("HmacSHA256");
       mac.init(new 
SecretKeySpec(stringToSign.getBytes(StandardCharsets.UTF_8), "HmacSHA256"));
       byte[] signData = mac.doFinal(new byte[] {});
-      String sign = new String(Base64.encodeBase64(signData));
+      String sign = new String(Base64.getEncoder().encode(signData));
       if (log.isDebugEnabled()) {
         log.debug("Calculate the signature success, sign:{}", sign);
       }
diff --git 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ProjectServiceImpl.java
 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ProjectServiceImpl.java
index 96da9fec4..7d2b53d43 100644
--- 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ProjectServiceImpl.java
+++ 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ProjectServiceImpl.java
@@ -302,7 +302,7 @@ public class ProjectServiceImpl extends 
ServiceImpl<ProjectMapper, Project>
       File file = new File(project.getDistHome(), project.getModule());
       File unzipFile = new File(file.getAbsolutePath().replaceAll(".tar.gz", 
""));
       if (!unzipFile.exists()) {
-        GZipUtils.decompress(file.getAbsolutePath(), 
file.getParentFile().getAbsolutePath());
+        GZipUtils.deCompress(file.getAbsolutePath(), 
file.getParentFile().getAbsolutePath());
       }
       List<Map<String, Object>> list = new ArrayList<>();
       File[] files = unzipFile.listFiles(x -> "conf".equals(x.getName()));
diff --git 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/task/FlinkRESTAPIWatcher.java
 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/task/FlinkRESTAPIWatcher.java
index e3551ef09..d32085b3c 100644
--- 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/task/FlinkRESTAPIWatcher.java
+++ 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/task/FlinkRESTAPIWatcher.java
@@ -38,7 +38,7 @@ import 
org.apache.streampark.console.core.service.SavePointService;
 import org.apache.streampark.console.core.service.alert.AlertService;
 
 import org.apache.commons.lang3.StringUtils;
-import org.apache.http.client.config.RequestConfig;
+import org.apache.hc.client5.http.config.RequestConfig;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
@@ -754,7 +754,8 @@ public class FlinkRESTAPIWatcher {
 
   private <T> T httpRestRequest(String url, Class<T> clazz) throws IOException 
{
     String result =
-        HttpClientUtils.httpGetRequest(url, 
RequestConfig.custom().setConnectTimeout(5000).build());
+        HttpClientUtils.httpGetRequest(
+            url, RequestConfig.custom().setConnectTimeout(5000, 
TimeUnit.MILLISECONDS).build());
     if (null == result) {
       return null;
     }
diff --git 
a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/ApplicationServiceTest.java
 
b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/ApplicationServiceTest.java
index 22274b2bc..aae093e7f 100644
--- 
a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/ApplicationServiceTest.java
+++ 
b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/ApplicationServiceTest.java
@@ -23,7 +23,7 @@ import org.apache.streampark.console.core.entity.Application;
 import org.apache.streampark.console.core.entity.YarnQueue;
 import org.apache.streampark.console.core.service.impl.ApplicationServiceImpl;
 
-import org.apache.http.entity.ContentType;
+import org.apache.hc.core5.http.ContentType;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import org.h2.store.fs.FileUtils;
diff --git a/streampark-flink/streampark-flink-connector/pom.xml 
b/streampark-flink/streampark-flink-connector/pom.xml
index 36d867d73..2712e4589 100644
--- a/streampark-flink/streampark-flink-connector/pom.xml
+++ b/streampark-flink/streampark-flink-connector/pom.xml
@@ -43,6 +43,7 @@
 
     <properties>
         <async.client.version>2.12.3</async.client.version>
+        <httpclient4.version>4.5.13</httpclient4.version>
     </properties>
 
     <dependencyManagement>
@@ -52,6 +53,13 @@
                 <artifactId>async-http-client</artifactId>
                 <version>${async.client.version}</version>
             </dependency>
+
+            <dependency>
+                <groupId>org.apache.httpcomponents</groupId>
+                <artifactId>httpclient</artifactId>
+                <version>${httpclient4.version}</version>
+            </dependency>
+
         </dependencies>
     </dependencyManagement>
 
diff --git 
a/streampark-flink/streampark-flink-connector/streampark-flink-connector-doris/pom.xml
 
b/streampark-flink/streampark-flink-connector/streampark-flink-connector-doris/pom.xml
index f7dc999e5..1fedfb502 100644
--- 
a/streampark-flink/streampark-flink-connector/streampark-flink-connector-doris/pom.xml
+++ 
b/streampark-flink/streampark-flink-connector/streampark-flink-connector-doris/pom.xml
@@ -34,6 +34,11 @@
             <version>${project.version}</version>
         </dependency>
 
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+        </dependency>
+
         <!-- provided -->
         <dependency>
             <groupId>org.apache.streampark</groupId>
diff --git 
a/streampark-flink/streampark-flink-connector/streampark-flink-connector-elasticsearch/pom.xml
 
b/streampark-flink/streampark-flink-connector/streampark-flink-connector-elasticsearch/pom.xml
index 328fdbc4e..0c1767b0c 100644
--- 
a/streampark-flink/streampark-flink-connector/streampark-flink-connector-elasticsearch/pom.xml
+++ 
b/streampark-flink/streampark-flink-connector/streampark-flink-connector-elasticsearch/pom.xml
@@ -41,6 +41,11 @@
             
<artifactId>streampark-flink-connector-base_${scala.binary.version}</artifactId>
             <version>${project.version}</version>
         </dependency>
+
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+        </dependency>
     </dependencies>
 
 </project>
diff --git 
a/streampark-flink/streampark-flink-connector/streampark-flink-connector-http/pom.xml
 
b/streampark-flink/streampark-flink-connector/streampark-flink-connector-http/pom.xml
index d98e937e9..3e37c22d6 100644
--- 
a/streampark-flink/streampark-flink-connector/streampark-flink-connector-http/pom.xml
+++ 
b/streampark-flink/streampark-flink-connector/streampark-flink-connector-http/pom.xml
@@ -40,6 +40,11 @@
             <artifactId>async-http-client</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+        </dependency>
+
         <!-- provided -->
         <dependency>
             <groupId>org.apache.streampark</groupId>
diff --git a/streampark-flink/streampark-flink-packer/pom.xml 
b/streampark-flink/streampark-flink-packer/pom.xml
index 37d2a78f0..61b78f30c 100644
--- a/streampark-flink/streampark-flink-packer/pom.xml
+++ b/streampark-flink/streampark-flink-packer/pom.xml
@@ -91,6 +91,12 @@
             <groupId>org.eclipse.aether</groupId>
             <artifactId>aether-transport-http</artifactId>
             <version>${eclipse.aether.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.httpcomponents</groupId>
+                    <artifactId>httpclient</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
 
         <dependency>

Reply via email to