qq_34911114
qq_34911114
2018-03-15 02:59
采纳率: 100%
浏览 4.3k
已采纳

spring cloud /bus/refresh接口返回405

spring clound都配置好之后,为什么localhost:8888/bus/refresh接口不能用,发送post请求
时,返回405
rabbitMQ:
*图片说明

  • 图片说明 pom
 <dependency>
            <groupId>org.springframework.retry</groupId>
            <artifactId>spring-retry</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-config-server -->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-config-server</artifactId>
            <version>2.0.0.M2</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-aop</artifactId>
        </dependency>
        <!--消息总线-->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-bus-amqp</artifactId>
        </dependency>
        <!--config设置监听 来接收发送来的post请求-->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-config-monitor</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

3条回答 默认 最新

  • qq_34911114
    qq_34911114 2018-03-15 03:26
    已采纳

    启动日志里面没有映射到/bus/refresh 我真是日乐uzi了 什么包也没缺啊 配置文件应该也没错啊

    点赞 评论
  • xinlus


    org.springframework.boot
    spring-boot-starter-parent
    1.5.9.RELEASE
    <!-- lookup parent from repository -->

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
        <spring-cloud.version>Edgware.RELEASE</spring-cloud.version>
    </properties>
    
    试了很长时间,也不是很理解,貌似是这两个的版本问题
    SpringBoot 版本为1.5.9   cloud版本为 Edgware.RELEASE  才可以
    
    点赞 评论
  • m0_46326173
    m0_46326173 2020-03-01 20:38

    #开启所有端点
    management:
    endpoints:
    web:
    exposure:
    include: "*"

    点赞 评论

相关推荐