This is an automated email from the ASF dual-hosted git repository.
gaoxihui pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozhera.git
The following commit(s) were added to refs/heads/master by this push:
new f8fbce0e feat: optimize agent channel map to prioritize IP-based
lookup (#640)
f8fbce0e is described below
commit f8fbce0e15b88904c26f58303866332b3c6d9143
Author: 张森昶 <[email protected]>
AuthorDate: Tue Mar 10 14:38:13 2026 +0800
feat: optimize agent channel map to prioritize IP-based lookup (#640)
* feat: optimize agent channel map to prioritize IP-based lookup
In getAgentChannelMap(), prioritize using the IP from AgentChannel
directly when available, falling back to parsing from the key string.
This improves reliability when agent connections use domain-based
resolution instead of direct IP connections.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* feat: bump log-agent-server version to 2.2.11-SNAPSHOT
Co-Authored-By: Claude Opus 4.6 <[email protected]>
---------
Co-authored-by: zhangsenchang <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
---
ozhera-log/log-agent-server/pom.xml | 2 +-
.../ozhera/log/server/service/DefaultPublishConfigService.java | 9 ++++++++-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/ozhera-log/log-agent-server/pom.xml
b/ozhera-log/log-agent-server/pom.xml
index 691da14c..8e660cc7 100644
--- a/ozhera-log/log-agent-server/pom.xml
+++ b/ozhera-log/log-agent-server/pom.xml
@@ -26,7 +26,7 @@ http://www.apache.org/licenses/LICENSE-2.0
<version>2.2.6-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <version>2.2.9-SNAPSHOT</version>
+ <version>2.2.11-SNAPSHOT</version>
<artifactId>log-agent-server</artifactId>
diff --git
a/ozhera-log/log-agent-server/src/main/java/org/apache/ozhera/log/server/service/DefaultPublishConfigService.java
b/ozhera-log/log-agent-server/src/main/java/org/apache/ozhera/log/server/service/DefaultPublishConfigService.java
index 4bc9946f..e0d3adc6 100644
---
a/ozhera-log/log-agent-server/src/main/java/org/apache/ozhera/log/server/service/DefaultPublishConfigService.java
+++
b/ozhera-log/log-agent-server/src/main/java/org/apache/ozhera/log/server/service/DefaultPublishConfigService.java
@@ -321,7 +321,14 @@ public class DefaultPublishConfigService implements
PublishConfigService {
private Map<String, AgentChannel> getAgentChannelMap() {
Map<String, AgentChannel> logAgentMap = new HashMap<>();
- AgentContext.ins().map.forEach((k, v) ->
logAgentMap.put(StringUtils.substringBefore(k, SYMBOL_COLON), v));
+ AgentContext.ins().map.forEach((k, v) -> {
+ String ip = v.getIp();
+ if (StringUtils.isNotBlank(ip)) {
+ logAgentMap.put(ip, v);
+ } else {
+ logAgentMap.put(StringUtils.substringBefore(k, SYMBOL_COLON),
v);
+ }
+ });
return logAgentMap;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]