spring-cloud / spring-cloud-bus

Spring Cloud event bus
http://cloud.spring.io/spring-cloud-bus/
Apache License 2.0
409 stars 242 forks source link

bus/refresh not working #127

Closed Jacky-LinPeng closed 5 years ago

Jacky-LinPeng commented 6 years ago

properties content:

server.port=8888
#################spring cloud基础配置#################
spring.application.name=wallet-config
#告诉他要去哪里注册eureka服务
eureka.client.service-url.defaultZone: http://localhost:8761/eureka/

#=================================git仓库信息=========================================
#git地址
spring.cloud.config.server.git.uri=https://gitee.com/linpeng_os/spring-cloud-config.git
#配置文件所在的分支
spring.cloud.config.label=master
#配置文件所在的目录
spring.cloud.config.server.git.search-paths=/**
#账号
spring.cloud.config.server.git.username=xxxxx
#密码
spring.cloud.config.server.git.password=xxxx

spring.rabbitmq.host=localhost
spring.rabbitmq.port=5672
spring.rabbitmq.username=guest
spring.rabbitmq.password=guest

spring.cloud.config.server.monitor.github=true
management.endpoints.web.exposure.include=bus-refresh

//============================================= pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.wallet</groupId>
    <artifactId>config</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>config</name>
    <description>Demo project for Spring Boot</description>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.2.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <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>Finchley.RELEASE</spring-cloud.version>
    </properties>

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

        <!-- eureka 客户端相关 start -->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
        </dependency>
        <!-- eureka 客户端相关 end-->

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <!--<scope>test</scope>-->
        </dependency>

        <!--bus消息总线-->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-bus-amqp</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <!--bus消息总线-->
        <!--config设置监听 来接收发送来的post请求-->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-config-monitor</artifactId>
        </dependency>

    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

========================================================

then I POST the url: http://localhost:8888/bus/refresh

I get this content:


{
  "timestamp": "2018-07-06T02:34:58.050+0000",
  "status": 405,
  "error": "Method Not Allowed",
  "message": "Request method 'POST' not supported",
  "path": "/bus/refresh"
}```
I need you help!
Jacky-LinPeng commented 6 years ago

POST the url: http://localhost:8888/actuator/bus-refresh

get response:

{ "timestamp": "2018-07-06T02:43:58.391+0000", "status": 415, "error": "Unsupported Media Type", "message": "Content type 'multipart/form-data;boundary=--------------------------153469588436788339830561;charset=UTF-8' not supported", "path": "/actuator/bus-refresh" }

Jacky-LinPeng commented 6 years ago

image get empety data

m-thirumal commented 5 years ago

Found solution? I am also facing same problem

spencergibb commented 5 years ago

Can you retry with the latest versions? for boot 2.0.x, Finchley.SR2 and boot 2.1.x Greenwich.RELEASE?

rcarlosdasilva commented 5 years ago

@spencergibb i using Finchley.SR2, and same problem happend.

but no /bus/refresh, no /bus/env

spencergibb commented 5 years ago

@rcarlosdasilva the new endpoints are /actuator/bus-refresh and /actuator/bus-env.

rcarlosdasilva commented 5 years ago

none of that, just have /actuator/health, /actuator/info, /actuator

rcarlosdasilva commented 5 years ago

@spencergibb i want to know the diff between actuator and monitor. i consider monitor can do refresh and notify clients through bus without actuator too, right? and starter-config-server already include actuator, so there is no need to add it again

like:

 <!--bus消息总线-->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-bus-amqp</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <!--bus消息总线-->
        <!--config设置监听 来接收发送来的post请求-->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-config-monitor</artifactId>
        </dependency>
spencergibb commented 5 years ago

monitor is not an actuator endpoint. It is a service that VCS webhooks can call to initiate a refresh via bus.

spring-projects-issues commented 5 years ago

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

spring-projects-issues commented 5 years ago

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

aiswariaDam commented 4 years ago

I got the same issue and solved it by changing the spring cloud version. Initially i was using Greenwich.RELEASE when i change it to - > Greenwich.SR1 , issue is solved