You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@linkis.apache.org by pe...@apache.org on 2022/08/25 07:21:26 UTC

[incubator-linkis] 06/09: fix: fix the restful route for cs publicServiceList, and add enable_pulbicservice judge

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

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

commit 668d245acc40bd85598b54c99ccfad9e072d6db5
Author: Jack Xu <xu...@126.com>
AuthorDate: Wed Aug 24 13:45:36 2022 +0800

    fix: fix the restful route for cs publicServiceList, and add enable_pulbicservice judge
---
 .../main/scala/org/apache/linkis/rpc/conf/RPCConfiguration.scala  | 2 +-
 .../apache/linkis/gateway/ujes/route/HaContextGatewayRouter.scala | 8 ++++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/linkis-commons/linkis-rpc/src/main/scala/org/apache/linkis/rpc/conf/RPCConfiguration.scala b/linkis-commons/linkis-rpc/src/main/scala/org/apache/linkis/rpc/conf/RPCConfiguration.scala
index 48df786c5..8a4fd6894 100644
--- a/linkis-commons/linkis-rpc/src/main/scala/org/apache/linkis/rpc/conf/RPCConfiguration.scala
+++ b/linkis-commons/linkis-rpc/src/main/scala/org/apache/linkis/rpc/conf/RPCConfiguration.scala
@@ -63,7 +63,7 @@ object RPCConfiguration {
 
   val PUBLIC_SERVICE_LIST: Array[String] = CommonVars(
     "wds.linkis.gateway.conf.publicservice.list",
-    "cs,data-source-manager,metadataquery,query,jobhistory,application,configuration,filesystem,udf,variable,microservice,errorcode,bml,datasource"
+    "cs,contextservice,data-source-manager,metadataquery,query,jobhistory,application,configuration,filesystem,udf,variable,microservice,errorcode,bml,datasource"
   ).getValue.split(",")
 
   val METADATAQUERY_SERVICE_APPLICATION_NAME: CommonVars[String] =
diff --git a/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-server-support/src/main/scala/org/apache/linkis/gateway/ujes/route/HaContextGatewayRouter.scala b/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-server-support/src/main/scala/org/apache/linkis/gateway/ujes/route/HaContextGatewayRouter.scala
index 5581965c9..89de5e0c7 100644
--- a/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-server-support/src/main/scala/org/apache/linkis/gateway/ujes/route/HaContextGatewayRouter.scala
+++ b/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-server-support/src/main/scala/org/apache/linkis/gateway/ujes/route/HaContextGatewayRouter.scala
@@ -27,6 +27,7 @@ import org.apache.linkis.gateway.springcloud.SpringCloudGatewayConfiguration.{
   normalPath,
   API_URL_PREFIX
 }
+import org.apache.linkis.rpc.conf.RPCConfiguration
 import org.apache.linkis.rpc.interceptor.ServiceInstanceUtils
 
 import org.apache.commons.lang3.StringUtils
@@ -157,8 +158,11 @@ class HaContextGatewayRouter extends AbstractGatewayRouter {
 object HaContextGatewayRouter {
   val CONTEXT_ID_STR: String = "contextId"
 
-  // because the ps-cs service had merged to ps-publicservice, so change the serviceName to ps-publicservice
-  val CONTEXT_SERVICE_NAME: String = "ps-publicservice"
+  val CONTEXT_SERVICE_NAME: String = if (RPCConfiguration.ENABLE_PUBLIC_SERVICE.getValue) {
+    RPCConfiguration.PUBLIC_SERVICE_APPLICATION_NAME.getValue
+  } else {
+    RPCConfiguration.CONTEXT_SERVICE_APPLICATION_NAME.getValue
+  }
 
   val CONTEXT_SERVICE_REQUEST_PREFIX = "contextservice"
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org