spring-cloud / spring-cloud-bus

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

Received remote refresh request. Keys refreshed [] #141

Closed ghost closed 5 years ago

ghost commented 5 years ago
<properties>
        <java.version>1.8</java.version>
        <spring-cloud.version>Greenwich.M3</spring-cloud.version>
    </properties>

my application.yml is here :

server:
  port: 8888
spring:
  cloud:
    config:
      server:
        git:
          uri: http://xxxxxx:3000/xiangmingchao/springcloud2.0.git
          username: xiangmingchao
          password: Deloitte12
          search-paths: config-repo
      label: master
    bus:
      trace:
        enabled: true
  application:
    name: config-server
  rabbitmq:
    addresses: 192.168.20.10:5672,192.168.20.4:5672,192.168.20.19:5672
    username: admin
    password: Deloitte12
eureka:
  client:
    service-url:
      defaultZone: http://deloitte:deloitte@192.168.20.20:8761/eureka/,http://deloitte:deloitte@192.168.20.24:8761/eureka/
  instance:
    prefer-ip-address: true
    instance-id: ${spring.cloud.client.ip-address}:${server.port}
management:
  endpoints:
    web:
      exposure:
        include: bus-refresh

this is the bug : 2018-12-11 18:16:15.398  INFO 24678 --- [nio-8888-exec-6] o.s.cloud.bus.event.RefreshListener      : Received remote refresh request. Keys refreshed []
2018-12-11 18:16:15.400  INFO 24678 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_CONFIG-SERVER/192.168.20.24:8888: registering service...
2018-12-11 18:16:15.411  INFO 24678 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_CONFIG-SERVER/192.168.20.24:8888 - registration status: 204
tail: config.log: file truncated
2018-12-11 18:17:57.886  INFO 25038 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'configurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$4325ab32] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
Activate the edition of the editorial spring cloudconfig Japanese springcloud bus rabbitMQ progressive matching concurrency / actuator / bus - refresh
spencergibb commented 5 years ago

Can you provide steps to recreate the problem? Better yet, can you provide a complete, minimal, verifiable sample that reproduces the problem? It should be available as a GitHub (or similar) project or attached to this issue as a zip file.

ghost commented 5 years ago

well i provide my all projects configurations for you! I only used these components. there are bus ,config config-server and rabbitMQ. You should know what i want to do

ghost commented 5 years ago

project version is below:

<properties>
        <java.version>1.8</java.version>
        <spring-cloud.version>Greenwich.M3</spring-cloud.version>
    </properties>

and spring-boot version is 2.1.1.RELEASE

ghost commented 5 years ago

this is my config-server application.yml.

server:
  port: 8888
spring:
  cloud:
    config:
      server:

        git:
          uri: http://xxx:3000/xiangmingchao/springcloud2.0.git
          username: xiangmingchao
          password: Deloitte12
          search-paths: config-repo
      label: master
    bus:
      trace:
        enabled: true
  application:
    name: config-server
  rabbitmq:
    addresses: 192.168.20.10:5672,192.168.20.4:5672,192.168.20.19:5672
    username: admin
    password: Deloitte12
eureka:
  client:
    service-url:
      defaultZone: http://deloitte:deloitte@192.168.20.20:8761/eureka/,http://deloitte:deloitte@192.168.20.24:8761/eureka/
  instance:
    prefer-ip-address: true
    instance-id: ${spring.cloud.client.ip-address}:${server.port}
management:
  endpoints:
    web:
      exposure:
        include: bus-refresh
ghost commented 5 years ago

here is my config-client bootstrap.yml.

server:
  port: 8762
spring:
  application:
    name: zuul
  rabbitmq:
    addresses: 192.168.20.10:5672,192.168.20.4:5672,192.168.20.19:5672
    username: admin
    password: Deloitte12
  #配置中心
  cloud:
    config:
      label: master
      discovery:
        enabled: true
        service-id: config-server
      fail-fast: true
      profile: dev
      retry:
        max-attempts: 3
        multiplier: 1.2
        initial-interval: 1000
        max-interval: 2000
    bus:
      trace:
        enabled: true
eureka:
  client:
    service-url:
      defaultZone: http://deloitte:deloitte@10.173.48.104:8761/eureka/,http://deloitte:deloitte@10.173.48.103:8761/eureka/
  instance:
    prefer-ip-address: true
    instance-id: ${spring.cloud.client.ip-address}:${server.port}
ghost commented 5 years ago

my config-client's test controller is below.

package com.deloitte.iddc.zuul.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther: zqin
 * @Date: 11/12/2018 11:04
 * @Description:
 */
@RefreshScope
@RestController
public class ConfigClientController {

    @Value("${feign.compression.request.min-request-size}")
    private String size;

    @GetMapping("/size")
    public String getProfile() {
        return this.size;
    }

}
ghost commented 5 years ago

my config-repo is here. its name is zuul-dev.yml.

#开启动态网关服务发现
ribbon:
  eureka:
    enabled: true
  ReadTimeout: 30000
  ConnectTimeout: 30000
#避免第一次调用失败
hystrix:
  command:
    default:
      execution:
        isolation:
          thread:
            timeoutInMilliseconds: 60000
#请求和响应GZIP压缩支持
feign:
  compression:
    request:
      enabled: true
      mime-types: text/xml,application/xml,application/json
      min-request-size: 6666
    response:
      enabled: true
  hystrix:
    enabled: true
#zuul 超时时间
zuul:
  host:
    socket-timeout-millis: 60000
    connect-timeout-millis: 60000
management:
  endpoints:
    web:
      exposure:
        include: bus-refresh
ghost commented 5 years ago

as you see above is my all configuration. feign.compression.request.min-request-size is most import 。i want change this value and push to my git .and then i use post man execute this operation that is http://xx.xx.xx.xx:8888/actuator/bus-refresh. i execute http://10.173.48.103:8762/size ,but nothing changed!

ghost commented 5 years ago

config-server console is printing this:

2018-12-11 19:48:42.894  INFO 27192 --- [nio-8888-exec-7] trationDelegate$BeanPostProcessorChecker : Bean 'configurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$b75000e8] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-12-11 19:48:42.941  INFO 27192 --- [nio-8888-exec-7] o.s.boot.SpringApplication               : No active profile set, falling back to default profiles: default
2018-12-11 19:48:42.947  INFO 27192 --- [nio-8888-exec-7] o.s.boot.SpringApplication               : Started application in 0.129 seconds (JVM running for 1308.367)
2018-12-11 19:48:43.034  INFO 27192 --- [nio-8888-exec-7] com.netflix.discovery.DiscoveryClient    : Shutting down DiscoveryClient ...
2018-12-11 19:48:43.151  INFO 27192 --- [nio-8888-exec-7] com.netflix.discovery.DiscoveryClient    : Unregistering ...
2018-12-11 19:48:43.158  INFO 27192 --- [nio-8888-exec-7] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_CONFIG-SERVER/192.168.20.24:8888 - deregister  status: 200
2018-12-11 19:48:43.166  INFO 27192 --- [nio-8888-exec-7] com.netflix.discovery.DiscoveryClient    : Completed shut down of DiscoveryClient
2018-12-11 19:48:43.167  INFO 27192 --- [nio-8888-exec-7] o.s.c.n.eureka.InstanceInfoFactory       : Setting initial instance status as: STARTING
2018-12-11 19:48:43.168  INFO 27192 --- [nio-8888-exec-7] com.netflix.discovery.DiscoveryClient    : Initializing Eureka in region us-east-1
2018-12-11 19:48:43.172  INFO 27192 --- [nio-8888-exec-7] c.n.d.provider.DiscoveryJerseyProvider   : Using JSON encoding codec LegacyJacksonJson
2018-12-11 19:48:43.172  INFO 27192 --- [nio-8888-exec-7] c.n.d.provider.DiscoveryJerseyProvider   : Using JSON decoding codec LegacyJacksonJson
2018-12-11 19:48:43.172  INFO 27192 --- [nio-8888-exec-7] c.n.d.provider.DiscoveryJerseyProvider   : Using XML encoding codec XStreamXml
2018-12-11 19:48:43.172  INFO 27192 --- [nio-8888-exec-7] c.n.d.provider.DiscoveryJerseyProvider   : Using XML decoding codec XStreamXml
2018-12-11 19:48:43.243  INFO 27192 --- [nio-8888-exec-7] c.n.d.s.r.aws.ConfigClusterResolver      : Resolving eureka endpoints via configuration
2018-12-11 19:48:43.244  INFO 27192 --- [nio-8888-exec-7] com.netflix.discovery.DiscoveryClient    : Disable delta property : false
2018-12-11 19:48:43.244  INFO 27192 --- [nio-8888-exec-7] com.netflix.discovery.DiscoveryClient    : Single vip registry refresh property : null
2018-12-11 19:48:43.244  INFO 27192 --- [nio-8888-exec-7] com.netflix.discovery.DiscoveryClient    : Force full registry fetch : false
2018-12-11 19:48:43.244  INFO 27192 --- [nio-8888-exec-7] com.netflix.discovery.DiscoveryClient    : Application is null : false
2018-12-11 19:48:43.244  INFO 27192 --- [nio-8888-exec-7] com.netflix.discovery.DiscoveryClient    : Registered Applications size is zero : true
2018-12-11 19:48:43.244  INFO 27192 --- [nio-8888-exec-7] com.netflix.discovery.DiscoveryClient    : Application version is -1: true
2018-12-11 19:48:43.244  INFO 27192 --- [nio-8888-exec-7] com.netflix.discovery.DiscoveryClient    : Getting all instance registry info from the eureka server
2018-12-11 19:48:43.356  INFO 27192 --- [nio-8888-exec-7] com.netflix.discovery.DiscoveryClient    : The response status is 200
2018-12-11 19:48:43.357  INFO 27192 --- [nio-8888-exec-7] com.netflix.discovery.DiscoveryClient    : Starting heartbeat executor: renew interval is: 30
2018-12-11 19:48:43.359  INFO 27192 --- [nio-8888-exec-7] c.n.discovery.InstanceInfoReplicator     : InstanceInfoReplicator onDemand update allowed rate per min is 4
2018-12-11 19:48:43.359  INFO 27192 --- [nio-8888-exec-7] com.netflix.discovery.DiscoveryClient    : Discovery Client initialized at timestamp 1544528923359 with initial instances count: 4
2018-12-11 19:48:43.362  INFO 27192 --- [nio-8888-exec-7] o.s.c.n.e.s.EurekaServiceRegistry        : Unregistering application CONFIG-SERVER with eureka with status DOWN
2018-12-11 19:48:43.362  WARN 27192 --- [nio-8888-exec-7] com.netflix.discovery.DiscoveryClient    : Saw local status change event StatusChangeEvent [timestamp=1544528923362, current=DOWN, previous=STARTING]
2018-12-11 19:48:43.362  INFO 27192 --- [nio-8888-exec-7] o.s.c.n.e.s.EurekaServiceRegistry        : Registering application CONFIG-SERVER with eureka with status UP
2018-12-11 19:48:43.363  WARN 27192 --- [nio-8888-exec-7] com.netflix.discovery.DiscoveryClient    : Saw local status change event StatusChangeEvent [timestamp=1544528923363, current=UP, previous=DOWN]
2018-12-11 19:48:43.363  INFO 27192 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_CONFIG-SERVER/192.168.20.24:8888: registering service...
2018-12-11 19:48:43.363  INFO 27192 --- [nio-8888-exec-7] o.s.cloud.bus.event.RefreshListener      : Received remote refresh request. Keys refreshed []
2018-12-11 19:48:43.372  INFO 27192 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_CONFIG-SERVER/192.168.20.24:8888 - registration status: 204
2018-12-11 19:48:43.372  INFO 27192 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_CONFIG-SERVER/192.168.20.24:8888: registering service...
2018-12-11 19:48:43.378  INFO 27192 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_CONFIG-SERVER/192.168.20.24:8888 - registration status: 204
ghost commented 5 years ago

but my config-client has no changes!

-12-11 19:27:23.933  INFO 18128 --- [nio-8762-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2018-12-11 19:27:23.951  INFO 18128 --- [nio-8762-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 18 ms
2018-12-11 19:32:15.100  INFO 18128 --- [trap-executor-0] c.n.d.s.r.aws.ConfigClusterResolver      : Resolving eureka endpoints via configuration
2018-12-11 19:37:15.102  INFO 18128 --- [trap-executor-0] c.n.d.s.r.aws.ConfigClusterResolver      : Resolving eureka endpoints via configuration
2018-12-11 19:42:15.103  INFO 18128 --- [trap-executor-0] c.n.d.s.r.aws.ConfigClusterResolver      : Resolving eureka endpoints via configuration
2018-12-11 19:47:15.105  INFO 18128 --- [trap-executor-0] c.n.d.s.r.aws.ConfigClusterResolver      : Resolving eureka endpoints via configuration
ghost commented 5 years ago

So I really want your help. It took me a whole day. I really can't help it.

spencergibb commented 5 years ago

Project as comments isn't helpful.

It should be available as a GitHub (or similar) project or attached to this issue as a zip file.

ghost commented 5 years ago

This is not a project, it's just an integration test. I don't think there's a problem with my configuration, but a possible bug in the integrated local source code.

ghost commented 5 years ago

The key is that spring cloud config and spring cloud bus use rabbitMQ to integrate.

spencergibb commented 5 years ago

I'm sorry. If you'd like me to take the time to investigate your issue please provide a project as requested and I'll reopen the issue

devlucasrezende commented 2 weeks ago

Hi @spencergibb how are you doing?

I have set up a Spring Cloud Config server to provide some configuration to a client server (using JDBC strategy) and I am using Kafka and busrefresh to reload any changes made to the database.

After clicking on /actuator/busrefresh, if any property is changed, it has been reflected in the clients, but in the logs it will appear:

o.s.cloud.bus.event.RefreshListener : Keys refreshed []

Could you investigate this?

You can find the project at the link below

https://github.com/devlucasrezende/spring-cloud-config/