From 19063ae3fe14f7a764ea2d3c9dfa04215c55ae49 Mon Sep 17 00:00:00 2001 From: JSamuel <313829429@qq.com> Date: Tue, 19 Dec 2023 11:12:56 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20BackendConfig=20-=20namingMap=EF=BC=8Ca?= =?UTF-8?q?dd=20default=20metadata=20map=20(#12)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --story=114894962 --- .../com/tencent/trpc/core/common/config/BackendConfig.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/trpc-core/src/main/java/com/tencent/trpc/core/common/config/BackendConfig.java b/trpc-core/src/main/java/com/tencent/trpc/core/common/config/BackendConfig.java index 873145941d..18aef78228 100644 --- a/trpc-core/src/main/java/com/tencent/trpc/core/common/config/BackendConfig.java +++ b/trpc-core/src/main/java/com/tencent/trpc/core/common/config/BackendConfig.java @@ -33,6 +33,7 @@ import com.tencent.trpc.core.worker.WorkerPoolManager; import com.tencent.trpc.core.worker.spi.WorkerPool; import java.net.InetSocketAddress; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; @@ -114,7 +115,11 @@ public class BackendConfig extends BaseProtocolConfig { * The parameters of naming's map and namingUrl together form the naming configuration and put namingOptions */ @ConfigProperty(name = "naming_map") - protected Map namingMap = Maps.newHashMap(); + protected Map namingMap = new HashMap() { + { + put(Constants.METADATA, Maps.newHashMap()); + } + }; /** * Environment */