无法为推送通知的spring-cloud-bus启用/监视端点 [英] Cannot enable /monitor endpoint for spring-cloud-bus for push notifications

查看:3460
本文介绍了无法为推送通知的spring-cloud-bus启用/监视端点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经配置spring cloud配置从git存储库读取属性。与当前实现如果配置中有更改,如果发布到/刷新在我的客户端,我可以看到更新的属性。现在,我想使用spring-cloud-bus-monitor来检测我的git repo中的更改,并自动刷新客户端终端中的属性。即使在依赖关系中添加了spring-cloud-config-monitor之后,/ monitor端点也未启用,因此即使配置服务器中的配置属性发生更改,也不会刷新。

I have configured spring cloud config to read properties from a git repository.With the current implementation if there is a change in the configuration, if post to /refresh on my client I am able to see the updated properties. Now, I would like to use the spring-cloud-bus-monitor to detect changes in my git repo and automatically refresh the properties in my client endpoints. Even after adding spring-cloud-config-monitor in the dependencies - the /monitor endpoint is not enabled, and therefore even when there are changes in the config properties in the config server - nothing gets refreshed.

我有一个在本地运行的RabbitMQ服务器。
赞赏任何关于如何获取/ monitor启用将通知推送到总线中所有客户端的指针

I have a RabbitMQ server running locally as well. Appreciate any pointers on how to get the /monitor enabled to push notifications to all the clients in the bus

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依赖关系:

server pom dependencies:

<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:

application.properties:

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

in client:

pom dependency in client:

        <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>


推荐答案

你不说什么版本,它只有在布里克斯顿(最新的是M5)。移除< scope> test< / scope>

You don't say what version you are using, it's only available in Brixton (the latest is M5). Remove <scope>test</scope>.

应该是:

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

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

监视器是用于由git托管服务webhooks。如果你使用一个文件系统,你必须使用 native 配置服务器配置文件。有关详细信息,请参见此处

Monitor is meant to be used by git hosting services webhooks. If you're using a filesystem you have to use the native config server profile. See here for more information.

这篇关于无法为推送通知的spring-cloud-bus启用/监视端点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆