HZERO开源版学习笔记一(注册中心)

HZERO-REGISTER

自己学习时的笔记,关于该模块基础概念请参考官网

HZERO开源版单注册节点

  1. 排除security
    类:org.hzero.register.RegisterApplication
    做法:
    在这里插入图片描述
    这里可以采取两种方式排除:
@EnableAutoConfiguration(exclude = {SecurityAutoConfiguration.class})
@SpringBootApplication(exclude = {SecurityAutoConfiguration.class })

HZERO采取了第二种,其实看SpringBootApplication的源码也会发现,这种做法是通过别名的方式完成的第一种做法。
在这里插入图片描述
通过这种方式取消默认的oauth2验证。

  1. 查询服务状态API
    我们可以看这个注册中心的这个类:
    org.hzero.register.api.InstanceController
    在这里插入图片描述
    比如访问IAM服务,可以得到如下响应:
GET http://localhost:8000/service-instances/hzero-iam

HTTP/1.1 200 OK
Connection: keep-alive
Transfer-Encoding: chunked
Content-Type: application/json;charset=UTF-8
Date: Tue, 26 Jan 2021 10:06:34 GMT

[
  {
   
   
    "host": "5.6.43.82",
    "port": 8030,
    "metadata": {
   
   
      "async.export.endpoint": "/async-export-endpoint",
      "management.port": "8031",
      "VERSION": "1.4.0"
    },
    "uri": "http://5.6.43.82:8030",
    "secure": false,
    "serviceId": "HZERO-IAM",
    "instanceInfo": {
   
   
      "instanceId": "DESKTOP-SAGSM2A:hzero-iam:8030",
      "app": "HZERO-IAM",
      "appGroupName": null,
      "ipAddr": "5.6.43.82",
      "sid": "na",
      "homePageUrl": "http://5.6.43.82:8030/"
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值