diff --git a/easy-retry-client/easy-retry-client-common/src/main/java/com/aizuda/easy/retry/client/common/netty/NettyChannel.java b/easy-retry-client/easy-retry-client-common/src/main/java/com/aizuda/easy/retry/client/common/netty/NettyChannel.java
index 73119a7d..7e7db02c 100644
--- a/easy-retry-client/easy-retry-client-common/src/main/java/com/aizuda/easy/retry/client/common/netty/NettyChannel.java
+++ b/easy-retry-client/easy-retry-client-common/src/main/java/com/aizuda/easy/retry/client/common/netty/NettyChannel.java
@@ -71,6 +71,13 @@ public class NettyChannel {
ServerProperties serverProperties = SpringContext.CONTEXT.getBean(ServerProperties.class);
EasyRetryProperties easyRetryProperties = SpringContext.CONTEXT.getBean(EasyRetryProperties.class);
+ // server配置不能为空
+ EasyRetryProperties.ServerConfig serverConfig = easyRetryProperties.getServer();
+ if (Objects.isNull(serverConfig)) {
+ LogUtils.error(log, "easy retry server config is null");
+ return;
+ }
+
Integer port = easyRetryProperties.getPort();
// 获取客户端指定的端口
if (Objects.isNull(port)) {
@@ -95,6 +102,7 @@ public class NettyChannel {
.set(HeadersEnum.CONTEXT_PATH.getKey(), Optional.ofNullable(serverProperties.getServlet().getContextPath()).orElse("/"))
.set(HeadersEnum.HOST_PORT.getKey(), port)
.set(HeadersEnum.VERSION.getKey(), GroupVersionCache.getVersion())
+ .set(HeadersEnum.HOST.getKey(), serverConfig.getHost())
;
//发送数据
diff --git a/easy-retry-common/easy-retry-common-core/src/main/java/com/aizuda/easy/retry/common/core/enums/HeadersEnum.java b/easy-retry-common/easy-retry-common-core/src/main/java/com/aizuda/easy/retry/common/core/enums/HeadersEnum.java
index 5427276f..6618a9e6 100644
--- a/easy-retry-common/easy-retry-common-core/src/main/java/com/aizuda/easy/retry/common/core/enums/HeadersEnum.java
+++ b/easy-retry-common/easy-retry-common-core/src/main/java/com/aizuda/easy/retry/common/core/enums/HeadersEnum.java
@@ -16,6 +16,7 @@ public enum HeadersEnum {
CONTEXT_PATH("context-path"),
REQUEST_ID("request-id"),
VERSION("version"),
+ HOST("Host"),
;
private final String key;
diff --git a/pom.xml b/pom.xml
index 3761323d..9325162e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,7 +21,7 @@
1.8
1.8
1.8
- 2.4.0
+ 2.5.0-SNAPSHOT
1.0.0
4.1.94.Final
5.8.19