-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
apollo python 客户端 #5089
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
Comments
🤖 根据我对Apollo仓库的了解,Apollo确实支持Python客户端。目前有三个Python客户端可供选择:
这些信息可以在Python SDK用户指南中找到。 关于环境变量的使用,Apollo也支持。在apollo-env.properties文件中,环境变量被用来设置不同配置的值。例如, 至于您提供的apollo-python客户端是否与Apollo的最新版本,Apollo 2.2.0 Release兼容,以及是否支持与Apollo仓库中列出的其他Python客户端相同的功能,或者与其他Python客户端相比是否有任何已知的问题或限制,我在仓库中没有找到相关信息。这些答案可能在其他地方可以找到,或者我可能遗漏了。 如果您能提供更多关于您的apollo-python客户端的信息,我可能能更好地回答您的问题。 SourcesThis response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions. |
This issue has been automatically closed because it has not had activity in the last 7 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions. |
包地址: https://pypi.org/project/apollo-python/
仓库:https://github.com/onecer/apollo-python
协议:MIT
公司用到,但是发现官网上提供的几个都不能用过了,参考了他们的代码,撸了一个可用的。
支持环境变量,方便 k8s 部署的服务从环境传递变量,不用挨个服务代码兼容。
以下是文档,如果适合,可以收录到官网。
安装
使用
导入包
也默认支持通过环境变量来传递值,基本和 Java 客户端保持一致
客户端初始化参数
配置变更监听器 change_listener
通知配置 notification_map
配置优先级
*** 环境变量 > 代码配置 ***
如果环境变量存在,则优先使用环境变量的值。
如果环境中存在 ENV的环境变量, 如 ENV=DEV。则优先组合出
DEV_META
这个环境变量名称来获取 config url。 如果该环境变量不存在,则取APOLLO_META
环境变量的值。如果APOLLO_META
也不存在,则使用代码定义的 config_url 的值。其它环境变量同理,以此类推。
热更新
默认会启动一个线程来定时更新本地缓存的配置,所以,如果每次用的是 get_value 来获取配置,可以实现配置热更新。
The text was updated successfully, but these errors were encountered: