Sfoglia il codice sorgente

Carry appName in FetchClusterServerInfo command

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
master
Eric Zhao 5 anni fa
parent
commit
094ba3bfba
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  1. +4
    -0
      sentinel-cluster/sentinel-cluster-server-default/src/main/java/com/alibaba/csp/sentinel/cluster/server/command/handler/FetchClusterServerInfoCommandHandler.java

+ 4
- 0
sentinel-cluster/sentinel-cluster-server-default/src/main/java/com/alibaba/csp/sentinel/cluster/server/command/handler/FetchClusterServerInfoCommandHandler.java Vedi File

@@ -27,6 +27,7 @@ import com.alibaba.csp.sentinel.command.CommandHandler;
import com.alibaba.csp.sentinel.command.CommandRequest;
import com.alibaba.csp.sentinel.command.CommandResponse;
import com.alibaba.csp.sentinel.command.annotation.CommandMapping;
import com.alibaba.csp.sentinel.util.AppNameUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;

@@ -69,6 +70,9 @@ public class FetchClusterServerInfoCommandHandler implements CommandHandler<Stri
.fluentPut("namespaceSet", namespaceSet)
.fluentPut("embedded", ClusterServerConfigManager.isEmbedded());

// Since 1.5.0 the appName is carried so that the caller can identify the appName of the token server.
info.put("appName", AppNameUtil.getAppName());

return CommandResponse.ofSuccess(info.toJSONString());
}



Loading…
Annulla
Salva