zoukankan      html  css  js  c++  java
  • springcloud2.x之management.security.enabled=false报错处理

    1. springcloud1.5.x的消息总线配置是

    # RabbitMq的地址、端口,用户名、密码
    spring.rabbitmq.host=localhost
    spring.rabbitmq.port=5672
    spring.rabbitmq.username=guest
    spring.rabbitmq.password=guest
    # 保证调用 /bus/refresh的时候不需要验证
    management.security.enabled=false

    configServer的启动类加上注解@RefreshScope

    configClient的启动类也加上注解@RefreshScope

    修改github上的配置文件之后,打开postman,请求方式是post,地址是http://localhost:8881/bus/refresh,这个端口号是configServer的。

    请求成功之后,返回的是空白,此时configClient就能获取到最新的配置信息。

    2.  springcloud2.x的消息总线配置是

    # RabbitMq的地址、端口,用户名、密码
    spring.rabbitmq.host=localhost
    spring.rabbitmq.port=5672
    spring.rabbitmq.username=guest
    spring.rabbitmq.password=guest
    
    # 刷新配置,在spring boot 2.x 之前1.x的management.security.enabled失效,新的配置为
    management.endpoints.web.exposure.include=bus-refresh

    configServer的启动类加上注解@RefreshScope

    configClient的启动类也加上注解@RefreshScope

    修改github上的配置文件之后,打开postman,请求方式是post,地址是http://localhost:8881/actuator/bus-refresh,这个端口号是configServer的。

    请求成功之后,返回的是空白,此时configClient就能获取到最新的配置信息。

    3. 需要注意的是configClient也要配置RabbiMq。

  • 相关阅读:
    python的struct模块
    Linux程序设计学习笔记(独乐乐版)
    理解AndroidX
    Android中的样式和主题
    Android中Fragment的使用
    Android 中Dialog的使用
    直接在apk中添加资源的研究
    Android签名生成和互转
    简单扒一下Volley源码,扩展Volley生命周期
    获取android所有联系人信息
  • 原文地址:https://www.cnblogs.com/hsz-csy/p/9733259.html
Copyright © 2011-2022 走看看