当前位置:网站首页>Openfeign service call
Openfeign service call
2022-04-23 03:02: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/04/202204220633252075.html
边栏推荐
- 《信息系统项目管理师总结》第五章 项目质量管理
- FileNotFoundError: [Errno 2] No such file or directory
- Q-Learning & Sarsa
- Encapsulation of ele table
- Restart redis
- Airtrack cracking wireless network password (Dictionary running method)
- tf. keras. layers. Conv? D function
- HLS / chisel practice CORDIC high performance computing complex square root
- MySQL function syntax
- Les derniers noeuds K de la liste jz22
猜你喜欢

Linux redis - redis database caching service

Log cutting - build a remote log collection server

Kubernetes - Introduction to actual combat
![How to use C language to realize [guessing numbers game]](/img/8c/052dcb0ce64ee1713bebb1340248e6.png)
How to use C language to realize [guessing numbers game]

The interface request takes too long. Jstack observes the lock holding

Specific field information of MySQL export table (detailed operation of Navicat client)

Some problems encountered in setting Django pure interface, channel and MySQL on the pagoda panel

How to write the expected salary on your resume to double your salary during the interview?

Onenet connection process

Er and eer models
随机推荐
Introduction to ACM [inclusion exclusion theorem]
Some problems encountered in setting Django pure interface, channel and MySQL on the pagoda panel
In redis cluster, the master node fails, and the IP changes after the master-slave switch. The client does not need to deal with it
Wepy learning record
Huawei machine test question -- deformation of hj53 Yang Hui triangle
The difference between encodeuri and encodeuricomponent
[Euler plan question 13] sum of large numbers
树莓派开发笔记(十二):入手研华ADVANTECH工控树莓派UNO-220套件(一):介绍和运行系统
Navicat premium import SQL file
AC & A2C & A3C
《信息系统项目管理师总结》第六章 项目人力资源管理
Domestic lightweight Kanban scrum agile project management tool
Log4j knowledge point record
Chapter VI project information management system summary
Classification and regression tree of machine learning
第46届ICPC亚洲区域赛(昆明) B Blocks(容斥+子集和DP+期望DP)
The problem of removing spaces from strings
[software testing] understand the basic knowledge of software testing
[learn junit5 from official documents] [II] [writingtests] [learning notes]
Chapter VII project communication management of information system project manager summary