consul教程:springboot服务注册与发现(3)-服务调用者ums 作者:马育民 • 2021-01-23 13:17 • 阅读:10037 # 介绍 notice服务用于向移动端发送通知,即:下图中的 【A微服务】 [![](https://www.malaoshi.top/upload/pic/consul/QQ20210123110925.png)](https://www.malaoshi.top/upload/pic/consul/QQ20210123110925.png) ### 工程下载 本工程: https://gitee.com/65242847/springcloud_consul/tree/master/ums_consul 所有工程: https://gitee.com/65242847/springcloud_consul ### 功能说明 提供2个http接口,都需要调用 【推送消息微服务】 才能实现功能 - `/follow`:关注 - `/getNotice`:根据id获取发送的消息 通过 openfeign、ribbon 两种方式,实现调用 微服务 ### 搭建说明 - 基础工程是:springboot - 添加 springcloud 依赖 - 添加 consul 依赖 - 添加 openfeign 依赖。底层依赖 ribbon,所以不需要添加 ribbon 依赖 - 在application.yml添加consul配置 ### 工程结构图 [![](https://www.malaoshi.top/upload/pic/consul/QQ20210123132449.png)](https://www.malaoshi.top/upload/pic/consul/QQ20210123132449.png) 原文出处:http://malaoshi.top/show_1IXSTlp0RuN.html