Skip to content

为什么ssm项目中使用@ApolloConfigChangeListener不能实时收到更新配置变化,而springboot项目可以呢 #38

@ls417316172

Description

@ls417316172
/**
 * 监听apollo中配置global 文件的变化来维护map集合
 * @param changeEvent
 */
@ApolloConfigChangeListener("global")
public void onChangeGlobal(ConfigChangeEvent changeEvent) {
	for (String key : changeEvent.changedKeys()) {
		ConfigChange change = changeEvent.getChange(key);
		System.err.println("==========global:"+key);
		map.put(key, change.getNewValue());
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions