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/06/08 10:13:18 UTC

[incubator-linkis] branch dev-1.1.3 updated: linkis-gateway-server-support - optimize EntranceExecutionGatewayParser (#2249)

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

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


The following commit(s) were added to refs/heads/dev-1.1.3 by this push:
     new 0745d2932 linkis-gateway-server-support - optimize EntranceExecutionGatewayParser (#2249)
0745d2932 is described below

commit 0745d2932d61ab7553c86636f21ccdd1f5ee3cab
Author: Alexyang <xu...@qq.com>
AuthorDate: Wed Jun 8 18:13:13 2022 +0800

    linkis-gateway-server-support - optimize EntranceExecutionGatewayParser (#2249)
---
 .../ujes/parser/EntranceExecutionGatewayParser.scala      | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-server-support/src/main/scala/org/apache/linkis/gateway/ujes/parser/EntranceExecutionGatewayParser.scala b/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-server-support/src/main/scala/org/apache/linkis/gateway/ujes/parser/EntranceExecutionGatewayParser.scala
index 70148357f..34b47791b 100644
--- a/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-server-support/src/main/scala/org/apache/linkis/gateway/ujes/parser/EntranceExecutionGatewayParser.scala
+++ b/linkis-spring-cloud-services/linkis-service-gateway/linkis-gateway-server-support/src/main/scala/org/apache/linkis/gateway/ujes/parser/EntranceExecutionGatewayParser.scala
@@ -51,20 +51,7 @@ class EntranceExecutionGatewayParser extends AbstractGatewayParser {
   override def parse(gatewayContext: GatewayContext): Unit = gatewayContext.getRequest.getRequestURI match {
     case EntranceExecutionGatewayParser.ENTRANCE_EXECUTION_REGEX(version, _) =>
       if (sendResponseWhenNotMatchVersion(gatewayContext, version)) return
-      val routeLabelsOption = parseToRouteLabels(gatewayContext)
-      val path = gatewayContext.getRequest.getRequestURI
-      val applicationName = if (routeLabelsOption.isDefined && routeLabelsOption.get.nonEmpty) {
-        val instances = insLabelService.searchInstancesByLabels(routeLabelsOption.get)
-        if (instances.isEmpty) {
-          GatewayConfiguration.ENTRANCE_SPRING_NAME.getValue
-        } else {
-          instances(0).getApplicationName
-        }
-      } else {
-        GatewayConfiguration.ENTRANCE_SPRING_NAME.getValue
-      }
-      info(s"GatewayParser parse requestUri $path to service ${applicationName}.")
-      gatewayContext.getGatewayRoute.setServiceInstance(ServiceInstance(applicationName, null))
+      gatewayContext.getGatewayRoute.setServiceInstance(ServiceInstance(GatewayConfiguration.ENTRANCE_SPRING_NAME.getValue, null))
     case _ =>
   }
 


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