当前位置:网站首页>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
边栏推荐
- HLS / chisel practice CORDIC high performance computing complex square root
- tf. keras. layers. Embedding function
- Classification of technology selection (2022)
- First knowledge of C language ~ branch statements
- How to build an integrated industrial Internet plus hazardous safety production management platform?
- tf. keras. layers. Timedistributed function
- Regular object type conversion tool - Common DOM class
- 《信息系统项目管理师总结》第四章 项目成本管理
- Dynamic sequence table + OJ
- Assembly learning Chapter III of assembly language (Third Edition) written by Wang Shuang
猜你喜欢

Opencv combines multiple pictures into video

How to write the expected salary on your resume to double your salary during the interview?
![[format] simple output (2)](/img/24/64739f5e6bbd54bfa9fb78b8c53c94.png)
[format] simple output (2)

How can enterprises with major hazard installations ensure the completion of the digital construction task of double prevention mechanism by the end of the year

tf. keras. layers. MaxPooling? D function

tf. keras. layers. Timedistributed function

The way to conquer C language
![Introduction to ACM [TSP problem]](/img/9f/4e3592542d989b2fbb6d82f7f2fbd2.png)
Introduction to ACM [TSP problem]

Er and eer models

tf. keras. layers. Embedding function
随机推荐
Airtrack cracking wireless network password (Dictionary running method)
VirtualBox virtual machine (Oracle VM)
Classification of technology selection (2022)
[if you want to do a good job, you must first use its tools] Guide for downloading and using paper editing and document management (endnote, latex, jabref, overflow) resources
The interface request takes too long. Jstack observes the lock holding
Codeforces round 784 (Div. 4) (a - H)
国产轻量级看板式Scrum敏捷项目管理工具
Codeforces Round #784 (Div. 4) (A - H)题解
Deep q-network (dqn)
The penultimate K nodes in jz22 linked list
Basic workflow of CPU
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
Basic SQL (VIII) data update operation practice
[learn junit5 from official documents] [II] [writingtests] [learning notes]
Shell script learning notes - regular expressions
Opencv fills the rectangle with a transparent color
tf. keras. layers. Inputlayer function
Winsock programming interface experiment: Ping
Table space capacity query and expansion of Oracle Database
【工欲善其事必先利其器】论文编辑及文献管理(Endnote,Latex,JabRef ,overleaf)资源下载及使用指南