当前位置:网站首页>Openfeign service call
Openfeign service call
2022-04-23 22:10:00 【Leon_ Jinhai_ Sun】
# 1. Service invocation method introduces dependency OpenFeign rely on <!--Open Feign rely on -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency># 2. Add comments to the entry class to open OpenFeign Support @SpringBootApplication
@EnableFeignClients
public class Users9999Application {
public static void main(String[] args) {
SpringApplication.run(Users9999Application.class, args);
}
}# 3. Create a client call interface //value Property to specify : Call service name
@FeignClient("PRODUCTS")
public interface ProductClient {
@GetMapping("/product/findAll") // Write the service call path
String findAll();
}# 4. Use feignClient The client object invokes the service // Inject client objects
@Autowired
private ProductClient productClient;
@GetMapping("/user/findAllFeignClient")
public String findAllFeignClient(){
log.info(" By using OpenFeign Component invokes goods and services ...");
String msg = productClient.findAll();
return msg;
}# 5. Access and test services
- http://localhost:9999/user/findAllFeignClient版权声明
本文为[Leon_ Jinhai_ Sun]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/113/202204232157393447.html
边栏推荐
- Ribbon service call
- Consumer turn off health monitoring check
- 将本地上的图片转换成Base64编码
- Cvpr2022 | efficient pre training based on knowledge distillation
- Database Experiment 5 Security Language Experiment
- C language programming based on loop structure (PTA)
- Common scenes of vector product in image
- 瑞萨IDE:CS+ for CC新建工程配置方法
- 成员函数和非成员函数
- 2. GPIO control summary (kernel driver) of nanopi M1 (Quanzhi H3)
猜你喜欢

2. GPIO control summary (kernel driver) of nanopi M1 (Quanzhi H3)

hystrix dashboard的使用

Basic introduction and use of ribbon components

三、zygote启动流程

OpenFeign调用详细日志展示

Consumer turns on health monitoring check

瑞萨IDE:CS+ for CC新建工程配置方法

服务间通信方式

Oracle ora-01033: Oracle initialization or shutdown in progressprocess solution

21. Basic usage of MariaDB
随机推荐
consul client客户端开发
Ribbon 服务调用
OpenFeign的参数传递之数组和集合类型
五个拿来就能用的炫酷登录页面
Database experiment I database definition and data import
Online Excel to CSV tool
Service invocation based on resttemplate
New engineering configuration method of Renesas + for CC:
LabVIEW设置应用程序显示标签透明
Basic introduction and use of ribbon components
清华大学 | WebFace260M:百万级深度人脸识别的基准(TPAMI2022)
服务间通信和RestTemplate完成服务间通信
Error message: b04access.00f eve'. Read of address 000001B4
Communication mode between services
A solution of C batch query
Database Experiment four View experiment
瑞萨IDE:CS+ for CC新建工程配置方法
Database experiment VI integrity language experiment
node了解
openFeign 服务调用