diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/config/ComponentLibraryCatalogService.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/config/ComponentLibraryCatalogService.java index 88ba44841..731da1825 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/config/ComponentLibraryCatalogService.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/config/ComponentLibraryCatalogService.java @@ -22,7 +22,6 @@ import java.io.FileNotFoundException; import java.io.Reader; import java.util.HashMap; import java.util.Map; -import org.apache.skywalking.oap.server.core.Const; import org.apache.skywalking.oap.server.library.util.ResourceUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -65,7 +64,7 @@ public class ComponentLibraryCatalogService implements IComponentLibraryCatalogS @Override public String getServerNameBasedOnComponent(int componentId) { Integer serverComponentId = componentId2ServerId.get(componentId); - return serverComponentId == null ? Const.UNKNOWN : getComponentName(serverComponentId); + return serverComponentId == null ? getComponentName(componentId) : getComponentName(serverComponentId); } private void init() throws InitialComponentCatalogException { @@ -96,10 +95,12 @@ public class ComponentLibraryCatalogService implements IComponentLibraryCatalogS nameMapping.forEach((name, serverName) -> { if (!componentName2Id.containsKey(name)) { - throw new InitialComponentCatalogException("Component name [" + name + "] in Component-Server-Mappings doesn't exist in component define. "); + throw new InitialComponentCatalogException( + "Component name [" + name + "] in Component-Server-Mappings doesn't exist in component define. "); } if (!componentName2Id.containsKey(serverName)) { - throw new InitialComponentCatalogException("Server componentId name [" + serverName + "] in Component-Server-Mappings doesn't exist in component define. "); + throw new InitialComponentCatalogException( + "Server componentId name [" + serverName + "] in Component-Server-Mappings doesn't exist in component define. "); } componentId2ServerId.put(componentName2Id.get(name), componentName2Id.get(serverName)); diff --git a/test/e2e/e2e-test/src/test/resources/expected/cluster/serviceInstanceTopo.yml b/test/e2e/e2e-test/src/test/resources/expected/cluster/serviceInstanceTopo.yml index bee3ab137..b5d8b2c49 100644 --- a/test/e2e/e2e-test/src/test/resources/expected/cluster/serviceInstanceTopo.yml +++ b/test/e2e/e2e-test/src/test/resources/expected/cluster/serviceInstanceTopo.yml @@ -24,13 +24,13 @@ nodes: name: not null serviceId: not null serviceName: e2e-service-provider - type: Unknown + type: not null isReal: true - id: not null name: not null serviceId: not null serviceName: e2e-service-provider - type: Unknown + type: not null isReal: true calls: - id: not null diff --git a/test/e2e/e2e-test/src/test/resources/expected/gateway/serviceInstanceTopo.yml b/test/e2e/e2e-test/src/test/resources/expected/gateway/serviceInstanceTopo.yml index a7803aed3..1b7dc9fc6 100644 --- a/test/e2e/e2e-test/src/test/resources/expected/gateway/serviceInstanceTopo.yml +++ b/test/e2e/e2e-test/src/test/resources/expected/gateway/serviceInstanceTopo.yml @@ -24,13 +24,13 @@ nodes: name: not null serviceId: not null serviceName: e2e-service-provider - type: Unknown + type: not null isReal: true - id: not null name: not null serviceId: not null serviceName: e2e-service-provider - type: Unknown + type: not null isReal: true calls: - id: not null diff --git a/test/e2e/e2e-test/src/test/resources/expected/gateway/topo.yml b/test/e2e/e2e-test/src/test/resources/expected/gateway/topo.yml index 412b10bff..2d67d716c 100644 --- a/test/e2e/e2e-test/src/test/resources/expected/gateway/topo.yml +++ b/test/e2e/e2e-test/src/test/resources/expected/gateway/topo.yml @@ -28,7 +28,7 @@ nodes: type: H2 - id: not null name: "gateway:80" - type: Unknown + type: not null calls: - id: not null source: ${User[0]}