zoukankan      html  css  js  c++  java
  • SpringCloud Config + SpringCloud Bus实时刷新配置的配置

    config-server的配置:

    application.yml:

    spring:
      application:
        name: config-server
      cloud:
        config:
          server:
            git:
              uri: https://gitee.com/xgpxg/spring-cloud-config
              username:   ***
              password:    ***
              search-paths: config/
      kafka:
          bootstrap-servers: ip:port
    eureka:
      client:
        service-url:
          defaultZone: http://localhost:5000/eureka
        healthcheck:
          enabled: true
    server:
      port: 5008
    
    management:
      endpoint:
        health:
          show-details: always
      endpoints:
        web:
          exposure:
            include: bus-refresh
            #注意这里的bus-refresh不能写成"*",否则会导致配置中心请求路径和bus-refresh冲突
    

    config-client配置

    bootstrap.yml

    eureka:
      client:
        service-url:
          defaultZone: http://localhost:5000/eureka
    
    
    spring:
      cloud:
        config:
          discovery:
            service-id: config-server
            enabled: true
          profile: dev
          label: master
          name: appconfig
    

    application.yml

    spring:
      application:
        name: service-a
      kafka:
        bootstrap-servers: ip:port
    
    eureka:
      client:
        service-url:
          defaultZone: http://localhost:5000/eureka
        healthcheck:
          enabled: true
    server:
      port: 5007
    
    management:
      endpoint:
        health:
          show-details: always
      endpoints:
        web:
          exposure:
            include: "*"
    

    application.yml中的配置可以写在bootstrap.yml里,但是需要去掉 healthcheck.enabled=true

    请求路径:http://localhost:5008/actuator/bus-refresh?destination=service-a

    注意是Post请求,否则405

  • 相关阅读:
    3.3 React Hooks
    ES6高阶函数
    ES6扩展运算符
    4.0不用npm,cnpm。使用yarn包启动react项目
    4.3 webpack打包学习
    4.2 Node.js模块化教程
    4.1React模块化
    vue组件化开发
    js箭头函数
    weblogic_exploit
  • 原文地址:https://www.cnblogs.com/cnsec/p/13286630.html
Copyright © 2011-2022 走看看