当前位置:网站首页>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;} 

边栏推荐
猜你喜欢
随机推荐
多商户商城系统功能拆解24讲-平台端分销会员
直播平台怎么搭建,原生js实现编辑器撤消/恢复功能
【诗歌】枕上诗书
微信小程序获取微信用户步数
Cmake 用法记录
ECCV 2022 | Microsoft Open Source TinyViT: Pre-training Capabilities for Small Models
Click: 377. Combined Sum Ⅳ
In-depth understanding of multithreading (Part 1)
MQTT X Web:在线的 MQTT 5.0 客户端工具
AppUser object extension based on ABP
经济衰退即将来临前CIO控制成本的七种方法
【JZOF】32从上往下打印二叉树
全面解析FPGA基础知识
Has your phone ever been monitored?
Eureka自我保护
2021年国内外五大BI厂商——优秀的商业智能工具推荐
【集训DAY3】挖金矿【二分答案】
ABAP中Collect的用法
拼多多店铺运营不得不知的留个运营小知识
CAD 截断线段









