当前位置:网站首页>Service Discovery @EnableDiscoveryClient
Service Discovery @EnableDiscoveryClient
2022-08-10 00:56:00 【A wind light cloud light】
@[email protected]@EnableDiscoveryClient //Service discoverypublic class PaymentMain8001{public static void main(String[] args){SpringApplication.run(PaymentMain8001.class,args);}}
@Resourceprivate DiscoveryClient discoveryClient;@GetMapping(value = "/payment/discovery")public Object discovery(){List services = discoveryClient.getServices();for (String element : services) {System.out.println(element);}List instances = discoveryClient.getInstances("CLOUD-PAYMENT-SERVICE");for (ServiceInstance element : instances) {System.out.println(element.getServiceId() + "\t" + element.getHost() + "\t" + element.getPort() + "\t"+ element.getUri());}return this.discoveryClient;}
边栏推荐
- 数据库优化 | 干货
- 【集训DAY5】选数字【数学】
- 金仓数据库 KingbaseGIS 使用手册(6.4. 几何对象存取函数)
- AirFlow介绍
- 2022-08-09 mysql/stonedb-慢SQL-Q16分析
- 【集训DAY3】石油储备计划【树形DP】
- Golden Warehouse Database KingbaseGIS User Manual (6.4. Geometry Object Access Function)
- How to match garbled characters regularly?
- AppUser object extension based on ABP
- ECCV 2022 | 微软开源TinyViT :搞定小模型的预训练能力
猜你喜欢
随机推荐
A Shanghai technology company was fined 220,000 for brushing orders, exposing the gray industry chain of online brushing
力扣:518. 零钱兑换 II
深圳堡垒机厂家有哪些?重点推荐哪家?
YOLOV5学习笔记(七)——训练自己数据集
6款跨境电商常用工具汇总
FreeRTOS任务基础
下班后用微信处理工作时发病身亡,法院判决:工伤!
【集训DAY4】询问【Hash】
蔚来杯2022牛客暑期多校训练营7 CFGJ
金仓数据库 KingbaseGIS 使用手册(6.5. 几何对象编辑函数)
32 JZOF 】 【 print down on binary tree
上海一科技公司刷单被罚22万,揭露网络刷单灰色产业链
什么是平面文件数据库? 如何导入多种格式的文件:DSV、JSON、XML?
【诗歌】最高级的惩罚就是沉默
Gold Warehouse Database KingbaseGIS User Manual (6.2. Management Functions)
Wireshark经典实践和面试13点总结
2022-08-09 mysql/stonedb-子查询性能提升-概论
Click: 377. Combined Sum Ⅳ
软考 --- 软件工程(7)软件项目管理(下)
Force buckle: 279. Perfect square