Carry appName in FetchClusterServerInfo command

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
This commit is contained in:
Eric Zhao 2019-03-01 09:45:54 +08:00
parent 01533543ef
commit 094ba3bfba
1 changed files with 4 additions and 0 deletions

View 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());
}