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>

2个回答

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

wgxaszc8
wgxaszc8 是不是被security拦截了,我也碰到的这个问题
一年多之前 回复
taolaia_11031208
taolaia_11031208 这答案就是煞笔,咋还采纳了
一年多之前 回复


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  才可以
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!