无法为 spring-cloud-bus 启用 /monitor 端点以进行推送通知

Cannot enable /monitor endpoint for spring-cloud-bus for push notifications

我已将 spring 云配置配置为从 git repository.With 当前实现中读取属性,如果配置发生变化,如果 post 到 /刷新我的客户端,我可以看到更新的属性。现在,我想使用 spring-cloud-bus-monitor 来检测我的 git 存储库中的更改并自动刷新我的客户端端点中的属性。即使在依赖项中添加 spring-cloud-config-monitor - /monitor 端点未启用,因此即使配置服务器中的配置属性发生变化 - 也不会刷新任何内容。

我在本地也有一个 RabbitMQ 服务器 运行。 感谢有关如何启用 /monitor 以向总线中的所有客户端推送通知的任何指示

http://localhost:8888/monitor

{
"timestamp": 1457025362412
"status": 405
"error": "Method Not Allowed"
"exception": "org.springframework.web.HttpRequestMethodNotSupportedException"
"message": "Request method 'POST' not supported"
"path": "/monitor"
}

o.s.cloud.bus.event.RefreshListener      : Received remote refresh request. Keys refreshed []

服务器 pom 依赖项:

<dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-config-monitor</artifactId>
        <scope>test</scope>
    </dependency>
     <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-bus-amqp</artifactId>
    </dependency>

application.properties:

spring.cloud.config.server.git.uri=file:\\C:\Users\spring-cloud-config
server.port=8888
spring.cloud.config.server.monitor.github=false 

客户端的pom依赖:

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-config-client</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-config</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-autoconfigure</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-config-monitor</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-bus-amqp</artifactId>
        </dependency>

你不用说你用的是什么版本,只有Brixton有(最新的是M5)。删除 <scope>test</scope>.

应该是:

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-config-monitor</artifactId>
</dependency>

spring-cloud-config-monitor 客户端不需要。

Monitor 旨在供 git 托管服务 webhooks 使用。如果您使用的是文件系统,则必须使用 native 配置服务器配置文件。有关详细信息,请参阅 here