当前位置:   article > 正文

Spring Cloud Consul配置Metadata_consul metadata

consul metadata

需求

实例注册到Consul时能够携带Metadata,这样其它实例就能够直接从Consul上获取该实例的Metadata信息。

调查

Spring Cloud Consul官方文档是这样说的:

Consul does not yet support metadata on services. Spring Cloud’s ServiceInstance has a Map<String, String> metadata field. Spring Cloud Consul uses Consul tags to approximate metadata until Consul officially supports metadata. Tags with the form key=value will be split and used as a Map key and value respectively. Tags without the equal = sign, will be used as both the key and value.

翻译下:

注册到Consul中的服务还不支持Metadata。Spring Cloud的ServiceInstance类中包含一个名为metadata,类型为Map<String, String>。在Consul没有官方支持medata之前,Spring Cloud Consul可以用Consul的tag
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/2023面试高手/article/detail/199243
推荐阅读
相关标签
  

闽ICP备14008679号