Skip to content

apollo settings Watch cannot hot update configuration normally #3020

@ly931003

Description

@ly931003

What happened:

apollo 设置 Watch 无法正常热更新配置

What you expected to happen:

可以热更新配置

How to reproduce it (as minimally and precisely as possible):

Apollo 版本: 0.10.2 或 2.10.0
Kratos Apollo: github.com/go-kratos/kratos/contrib/config/apollo/v2 v2.0.0-20230830131453-6c026bce56a9
使用yaml作为namespace的格式,设置对应字段 Watch

Anything else we need to know?:

通过注释 func (c *customChangeListener) onChange 方法中对 yaml 等格式的特判操作即可正常使用
c.apollo.client.GetConfigCache(namespace).Get("content") 无法正常获取数据,没有这个字段

Environment:

  • Kratos version (use kratos -v): v2.7.0
  • Go version (use go version): go1.20.3 windows/amd64
  • OS (e.g: cat /etc/os-release): Windows 10 专业工作站版 22H2 19045.3448
  • Others: github.com/go-kratos/kratos/contrib/config/apollo/v2 v2.0.0-20230830131453-6c026bce56a9

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions