-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Push yaml format #6493
Push yaml format #6493
Conversation
push 配置时指定内容类型,原推送String格式的yaml时,指定不了格式,导致推送上去没有实现yaml格式
push时,指定不了格式,导致格式为txt文本,添加指定格式接口
There are some conflicts, Please fix it first. |
* @param content content | ||
* @param type type | ||
* @return Whether publish | ||
* @throws NacosException NacosException |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add since
annotation like @since 2.1.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add complete
* @param type type | ||
* @return Whether publish | ||
* @throws NacosException NacosException | ||
* @since 1.4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this interface has added in 1.4?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, this problem has been solved and does not need to be modified. Please refuse.
Because I found this problem when I used Nacos last August. At that time, this problem had not been solved. For some reasons, I delayed until now to upload my solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides, We're all Chinese. Why not communicate in Chinese?Isn't it better for foreigners to learn Chinese,just kidding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We recommend using English to allow more non-Chinese users to understand the context, but our community does not mandate it.
I will close this PR. |
通过ConfigService.publishConfig接口推送配置:
原调用推送接口代码:
String content = yaml.dumpAs(gateway, Tag.MAP, null);
configService.publishConfig(prop.getDataId(), prop.getGroup(), content);
只能推送String类型的配置内容,并且不能指定配置内容类型为yaml
现增加type参数:
String content = yaml.dumpAs(gateway, Tag.MAP, null);
configService.publishConfig(prop.getDataId(), prop.getGroup(), content,"yaml");
解决通过此接口推送配置不能推送yaml格式的问题