spring-cloud / spring-cloud-config

External configuration (server and client) for Spring Cloud
Apache License 2.0
1.95k stars 1.29k forks source link

when i put spring-cloud-starter-bus-amqp into pom,i find the server Fetch config twice #1419

Closed xlb closed 5 years ago

xlb commented 5 years ago

as i said,i use spring-cloud-starter-bus-amqp to refresh config,but when i put it in,when i start my client server,it just Fetch config twice,i dont konw is that right.

My springboot version is 2.0.3 and my springcloud version is Finchley.RELEASE.

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-bus-amqp</artifactId>
    </dependency>

here are my client config

`server: port: 9301 spring: application: name: eam-spc profiles: active: dev cloud: config: discovery: enabled: true service-id: eam-config-server profile: ${spring.profiles.active} label: ${spring.profiles.active} fail-fast: true name: ${spring.application.name},mysql,mybatisplus

eureka: instance: prefer-ip-address: true client: service-url: defaultZone: http://eam-server:8761/eureka/ and here is the log 2019-07-05 17:00:32.720 [main] INFO o.s.c.a.AnnotationConfigApplicationContext - Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@60641ec8: startup date [Fri Jul 05 17:00:32 CST 2019]; root of context hierarchy 2019-07-05 17:00:33.403 [main] INFO o.s.b.f.a.AutowiredAnnotationBeanPostProcessor - JSR-330 'javax.inject.Inject' annotation found and supported for autowiring 2019-07-05 17:00:33.747 [main] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.retry.annotation.RetryConfiguration' of type [org.springframework.retry.annotation.RetryConfiguration$$EnhancerBySpringCGLIB$$acd97d1b] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-07-05 17:00:33.811 [main] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'configurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$d32fe7f3] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-07-05 17:00:34.802 [main] INFO o.s.cloud.netflix.eureka.InstanceInfoFactory - Setting initial instance status as: STARTING 2019-07-05 17:00:34.917 [main] INFO com.netflix.discovery.DiscoveryClient - Initializing Eureka in region us-east-1 2019-07-05 17:00:36.042 [main] INFO c.n.discovery.provider.DiscoveryJerseyProvider - Using JSON encoding codec LegacyJacksonJson 2019-07-05 17:00:36.043 [main] INFO c.n.discovery.provider.DiscoveryJerseyProvider - Using JSON decoding codec LegacyJacksonJson 2019-07-05 17:00:36.282 [main] INFO c.n.discovery.provider.DiscoveryJerseyProvider - Using XML encoding codec XStreamXml 2019-07-05 17:00:36.282 [main] INFO c.n.discovery.provider.DiscoveryJerseyProvider - Using XML decoding codec XStreamXml 2019-07-05 17:00:36.659 [main] INFO c.n.d.shared.resolver.aws.ConfigClusterResolver - Resolving eureka endpoints via configuration 2019-07-05 17:00:37.085 [main] INFO com.netflix.discovery.DiscoveryClient - Disable delta property : false 2019-07-05 17:00:37.086 [main] INFO com.netflix.discovery.DiscoveryClient - Single vip registry refresh property : null 2019-07-05 17:00:37.087 [main] INFO com.netflix.discovery.DiscoveryClient - Force full registry fetch : false 2019-07-05 17:00:37.087 [main] INFO com.netflix.discovery.DiscoveryClient - Application is null : false 2019-07-05 17:00:37.087 [main] INFO com.netflix.discovery.DiscoveryClient - Registered Applications size is zero : true 2019-07-05 17:00:37.088 [main] INFO com.netflix.discovery.DiscoveryClient - Application version is -1: true 2019-07-05 17:00:37.088 [main] INFO com.netflix.discovery.DiscoveryClient - Getting all instance registry info from the eureka server 2019-07-05 17:00:37.338 [main] INFO com.netflix.discovery.DiscoveryClient - The response status is 200 2019-07-05 17:00:37.342 [main] INFO com.netflix.discovery.DiscoveryClient - Not registering with Eureka server per configuration 2019-07-05 17:00:37.348 [main] INFO com.netflix.discovery.DiscoveryClient - Discovery Client initialized at timestamp 1562317237345 with initial instances count: 11

. _ _ /\ / '_ () \ \ \ \ ( ( )\ | ' | '| | ' \/ ` | \ \ \ \ \/ _)| |)| | | | | || (| | ) ) ) ) ' |__| .|| ||| |\, | / / / / =========|_|==============|__/=//// :: Spring Boot :: (v2.0.3.RELEASE)

2019-07-05 17:00:38.298 [main] INFO o.s.c.c.client.ConfigServicePropertySourceLocator - Fetching config from server at : http://192.168.82.178:6671/ 2019-07-05 17:00:40.809 [main] INFO o.s.c.c.client.ConfigServicePropertySourceLocator - Located environment: name=eam-spc,mysql,mybatisplus, profiles=[dev], label=dev, version=8b7018c542b32543f9809a96710d141304ed5b98, state=null 2019-07-05 17:00:40.810 [main] INFO o.s.c.b.c.PropertySourceBootstrapConfiguration - Located property source: CompositePropertySource {name='configService', propertySources=[MapPropertySource {name='configClient'}, MapPropertySource {name='https://github.com/xlb/eam-cloud-conf/mybatisplus-dev.yml'}, MapPropertySource {name='https://github.com/xlb/eam-cloud-conf/mysql-dev.yml'}, MapPropertySource {name='https://github.com/xlb/eam-cloud-conf/application-dev.yml'}]} 2019-07-05 17:00:40.887 [main] INFO com.soptop.eam.spc.EamSpcApplication - The following profiles are active: dev 2019-07-05 17:00:40.902 [main] INFO o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@697a0948: startup date [Fri Jul 05 17:00:40 CST 2019]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@60641ec8 2019-07-05 17:00:41.696 [main] WARN org.mybatis.spring.mapper.ClassPathMapperScanner - No MyBatis mapper was found in '[com.soptop.eam.spc.mapper]' package. Please check your configuration. 2019-07-05 17:00:41.840 [main] WARN org.mybatis.spring.mapper.ClassPathMapperScanner - No MyBatis mapper was found in '[com.soptop.eam.spc]' package. Please check your configuration. 2019-07-05 17:00:42.222 [main] INFO o.s.integration.config.IntegrationRegistrar - No bean named 'integrationHeaderChannelRegistry' has been explicitly defined. Therefore, a default DefaultHeaderChannelRegistry will be created. 2019-07-05 17:00:42.320 [main] INFO o.s.c.a.ConfigurationClassBeanDefinitionReader - Skipping bean definition for [BeanMethod:name=configurableCompositeMessageConverter,declaringClass=org.springframework.cloud.stream.config.ContentTypeConfiguration]: a definition for bean 'integrationArgumentResolverMessageConverter' already exists. This top-level bean definition is considered as an override. 2019-07-05 17:00:42.695 [main] INFO o.s.b.factory.support.DefaultListableBeanFactory - Overriding bean definition for bean 'dataSource' with a different definition: replacing [Root bean: class [null]; scope=refresh; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=false; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari; factoryMethodName=dataSource; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]] with [Root bean: class [org.springframework.aop.scope.ScopedProxyFactoryBean]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in BeanDefinition defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]] 2019-07-05 17:00:43.198 [main] INFO o.springframework.cloud.context.scope.GenericScope - BeanFactory id=ab215d2b-0777-3cb1-a780-b729af926d13 2019-07-05 17:00:43.257 [main] INFO o.s.i.c.DefaultConfiguringBeanFactoryPostProcessor - No bean named 'errorChannel' has been explicitly defined. Therefore, a default PublishSubscribeChannel will be created. 2019-07-05 17:00:43.260 [main] INFO o.s.i.c.DefaultConfiguringBeanFactoryPostProcessor - No bean named 'taskScheduler' has been explicitly defined. Therefore, a default ThreadPoolTaskScheduler will be created. 2019-07-05 17:00:43.277 [main] INFO o.s.b.f.a.AutowiredAnnotationBeanPostProcessor - JSR-330 'javax.inject.Inject' annotation found and supported for autowiring 2019-07-05 17:00:43.382 [main] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.amqp.rabbit.annotation.RabbitBootstrapConfiguration' of type [org.springframework.amqp.rabbit.annotation.RabbitBootstrapConfiguration$$EnhancerBySpringCGLIB$$7d81a324] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-07-05 17:00:44.032 [main] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$b715e4f6] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-07-05 17:00:44.132 [main] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.integration.config.IntegrationManagementConfiguration' of type [org.springframework.integration.config.IntegrationManagementConfiguration$$EnhancerBySpringCGLIB$$2207a025] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-07-05 17:00:44.241 [main] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$d32fe7f3] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-07-05 17:00:44.358 [main] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.integration.dsl.context.IntegrationFlowContext' of type [org.springframework.integration.dsl.context.IntegrationFlowContext] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-07-05 17:00:45.136 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port(s): 9301 (http) 2019-07-05 17:00:45.167 [main] INFO org.apache.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-9301"] 2019-07-05 17:00:45.195 [main] INFO org.apache.catalina.core.StandardService - Starting service [Tomcat] 2019-07-05 17:00:45.196 [main] INFO org.apache.catalina.core.StandardEngine - Starting Servlet Engine: Apache Tomcat/8.5.31 2019-07-05 17:00:45.214 [localhost-startStop-1] INFO org.apache.catalina.core.AprLifecycleListener - The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jdk1.8.0_131\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files\Java\jdk1.8.0_131\jre\bin;C:/Program Files/Java/jre1.8.0_131/bin/server;C:/Program Files/Java/jre1.8.0_131/bin;C:/Program Files/Java/jre1.8.0131/lib/amd64;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Program Files\TortoiseGit\bin;C:\Program Files\Git\cmd;C:\Users\yqxulb\AppData\Local\Microsoft\WindowsApps;C:\Users\yqxulb\AppData\Roaming\npm;C:\Users\yqxulb\AppData\Local\Programs\Microsoft VS Code\bin;E:\BaiduNetdiskDownload\eclipse;;.] 2019-07-05 17:00:45.661 [localhost-startStop-1] INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext 2019-07-05 17:00:45.662 [localhost-startStop-1] INFO org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization completed in 4760 ms 2019-07-05 17:00:46.421 [localhost-startStop-1] WARN com.netflix.config.sources.URLConfigurationSource - No URLs will be polled as dynamic configuration sources. 2019-07-05 17:00:46.422 [localhost-startStop-1] INFO com.netflix.config.sources.URLConfigurationSource - To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath. 2019-07-05 17:00:46.462 [localhost-startStop-1] INFO com.netflix.config.DynamicPropertyFactory - DynamicPropertyFactory is initialized with configuration sources: com.netflix.config.ConcurrentCompositeConfiguration@5a843058 2019-07-05 17:00:52.173 [localhost-startStop-1] INFO o.s.scheduling.concurrent.ThreadPoolTaskScheduler - Initializing ExecutorService 'taskScheduler' 2019-07-05 17:00:53.255 [localhost-startStop-1] INFO o.s.boot.web.servlet.FilterRegistrationBean - Mapping filter: 'characterEncodingFilter' to: [/] 2019-07-05 17:00:53.256 [localhost-startStop-1] INFO o.s.boot.web.servlet.FilterRegistrationBean - Mapping filter: 'tracingFilter' to: [/] 2019-07-05 17:00:53.256 [localhost-startStop-1] INFO o.s.boot.web.servlet.FilterRegistrationBean - Mapping filter: 'exceptionLoggingFilter' to: [/] 2019-07-05 17:00:53.257 [localhost-startStop-1] INFO o.s.boot.web.servlet.FilterRegistrationBean - Mapping filter: 'hiddenHttpMethodFilter' to: [/] 2019-07-05 17:00:53.257 [localhost-startStop-1] INFO o.s.boot.web.servlet.FilterRegistrationBean - Mapping filter: 'httpPutFormContentFilter' to: [/] 2019-07-05 17:00:53.257 [localhost-startStop-1] INFO o.s.boot.web.servlet.FilterRegistrationBean - Mapping filter: 'requestContextFilter' to: [/] 2019-07-05 17:00:53.257 [localhost-startStop-1] INFO o.s.boot.web.servlet.FilterRegistrationBean - Mapping filter: 'httpTraceFilter' to: [/] 2019-07-05 17:00:53.257 [localhost-startStop-1] INFO o.s.boot.web.servlet.FilterRegistrationBean - Mapping filter: 'webMvcMetricsFilter' to: [/] 2019-07-05 17:00:53.257 [localhost-startStop-1] INFO o.s.boot.web.servlet.ServletRegistrationBean - Servlet dispatcherServlet mapped to [/] 2019-07-05 17:00:53.454 [main] WARN com.netflix.config.sources.URLConfigurationSource - No URLs will be polled as dynamic configuration sources. 2019-07-05 17:00:53.454 [main] INFO com.netflix.config.sources.URLConfigurationSource - To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath. 2019-07-05 17:00:53.676 [main] INFO o.s.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [//favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] 2019-07-05 17:00:54.169 [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerAdapter - Looking for @ControllerAdvice: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@697a0948: startup date [Fri Jul 05 17:00:40 CST 2019]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@60641ec8 2019-07-05 17:00:54.340 [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest) 2019-07-05 17:00:54.342 [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) 2019-07-05 17:00:54.514 [main] INFO o.s.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/webjars/] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] 2019-07-05 17:00:54.514 [main] INFO o.s.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] Logging initialized using 'class org.apache.ibatis.logging.stdout.StdOutImpl' adapter. 2019-07-05 17:00:55.051 [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting... 2019-07-05 17:00:55.393 [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Start completed. Registered plugin: 'AbstractSqlParserHandler(sqlParserList=null, sqlParserFilter=null)' Registered plugin: 'com.baomidou.mybatisplus.extension.plugins.OptimisticLockerInterceptor@1a1f22f2' Property 'mapperLocations' was not specified. | |_. __ | | | |\/|)(| | |\ |)|||_\ / |
3.1.2 2019-07-05 17:00:56.478 [main] INFO o.s.ui.freemarker.SpringTemplateLoader - SpringTemplateLoader for FreeMarker: using resource loader [org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@697a0948: startup date [Fri Jul 05 17:00:40 CST 2019]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@60641ec8] and template loader path [classpath:/templates/] 2019-07-05 17:00:56.481 [main] INFO o.s.w.servlet.view.freemarker.FreeMarkerConfigurer - ClassTemplateLoader for Spring macros added to FreeMarker configuration 2019-07-05 17:00:58.682 [main] INFO com.netflix.discovery.DiscoveryClient - Shutting down DiscoveryClient ... 2019-07-05 17:00:58.696 [main] INFO com.netflix.discovery.DiscoveryClient - Completed shut down of DiscoveryClient 2019-07-05 17:00:59.056 [main] INFO o.s.b.actuate.endpoint.web.EndpointLinksResolver - Exposing 2 endpoint(s) beneath base path '/actuator' 2019-07-05 17:00:59.083 [main] INFO o.s.b.a.e.web.servlet.WebMvcEndpointHandlerMapping - Mapped "{[/actuator/health],methods=[GET],produces=[application/vnd.spring-boot.actuator.v2+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping$OperationHandler.handle(javax.servlet.http.HttpServletRequest,java.util.Map<java.lang.String, java.lang.String>) 2019-07-05 17:00:59.085 [main] INFO o.s.b.a.e.web.servlet.WebMvcEndpointHandlerMapping - Mapped "{[/actuator/info],methods=[GET],produces=[application/vnd.spring-boot.actuator.v2+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping$OperationHandler.handle(javax.servlet.http.HttpServletRequest,java.util.Map<java.lang.String, java.lang.String>) 2019-07-05 17:00:59.088 [main] INFO o.s.b.a.e.web.servlet.WebMvcEndpointHandlerMapping - Mapped "{[/actuator],methods=[GET],produces=[application/vnd.spring-boot.actuator.v2+json || application/json]}" onto protected java.util.Map<java.lang.String, java.util.Map<java.lang.String, org.springframework.boot.actuate.endpoint.web.Link>> org.springframework.boot.actuate.endpoint.web.servlet.WebMvcEndpointHandlerMapping.links(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) 2019-07-05 17:00:59.357 [main] INFO o.s.jmx.export.annotation.AnnotationMBeanExporter - Registering beans for JMX exposure on startup 2019-07-05 17:00:59.359 [main] INFO o.s.jmx.export.annotation.AnnotationMBeanExporter - Bean with name 'dataSource' has been autodetected for JMX exposure 2019-07-05 17:00:59.368 [main] INFO o.s.jmx.export.annotation.AnnotationMBeanExporter - Bean with name 'rabbitConnectionFactory' has been autodetected for JMX exposure 2019-07-05 17:00:59.370 [main] INFO o.s.jmx.export.annotation.AnnotationMBeanExporter - Bean with name 'environmentManager' has been autodetected for JMX exposure 2019-07-05 17:00:59.371 [main] INFO o.s.jmx.export.annotation.AnnotationMBeanExporter - Bean with name 'integrationMbeanExporter' has been autodetected for JMX exposure 2019-07-05 17:00:59.372 [main] INFO o.s.jmx.export.annotation.AnnotationMBeanExporter - Bean with name 'refreshScope' has been autodetected for JMX exposure 2019-07-05 17:00:59.374 [main] INFO o.s.jmx.export.annotation.AnnotationMBeanExporter - Bean with name 'configurationPropertiesRebinder' has been autodetected for JMX exposure 2019-07-05 17:00:59.380 [main] INFO o.s.jmx.export.annotation.AnnotationMBeanExporter - Located managed bean 'environmentManager': registering with JMX server as MBean [org.springframework.cloud.context.environment:name=environmentManager,type=EnvironmentManager] 2019-07-05 17:00:59.393 [main] INFO o.s.jmx.export.annotation.AnnotationMBeanExporter - Located managed bean 'refreshScope': registering with JMX server as MBean [org.springframework.cloud.context.scope.refresh:name=refreshScope,type=RefreshScope] 2019-07-05 17:00:59.411 [main] INFO o.s.jmx.export.annotation.AnnotationMBeanExporter - Located managed bean 'integrationMbeanExporter': registering with JMX server as MBean [org.springframework.integration.monitor:name=integrationMbeanExporter,type=IntegrationMBeanExporter] 2019-07-05 17:00:59.454 [main] INFO o.s.jmx.export.annotation.AnnotationMBeanExporter - Located managed bean 'configurationPropertiesRebinder': registering with JMX server as MBean [org.springframework.cloud.context.properties:name=configurationPropertiesRebinder,context=697a0948,type=ConfigurationPropertiesRebinder] 2019-07-05 17:00:59.462 [main] INFO o.s.jmx.export.annotation.AnnotationMBeanExporter - Located MBean 'dataSource': registering with JMX server as MBean [com.zaxxer.hikari:name=dataSource,type=HikariDataSource] 2019-07-05 17:00:59.465 [main] INFO o.s.jmx.export.annotation.AnnotationMBeanExporter - Located managed bean 'rabbitConnectionFactory': registering with JMX server as MBean [org.springframework.amqp.rabbit.connection:name=rabbitConnectionFactory,type=CachingConnectionFactory] 2019-07-05 17:00:59.502 [main] INFO o.s.integration.monitor.IntegrationMBeanExporter - Registering beans for JMX exposure on startup 2019-07-05 17:00:59.502 [main] INFO o.s.integration.monitor.IntegrationMBeanExporter - Registering MessageChannel errorChannel 2019-07-05 17:00:59.508 [main] INFO o.s.integration.monitor.IntegrationMBeanExporter - Located managed bean 'org.springframework.integration:type=MessageChannel,name=errorChannel': registering with JMX server as MBean [org.springframework.integration:type=MessageChannel,name=errorChannel] 2019-07-05 17:00:59.580 [main] INFO o.s.integration.monitor.IntegrationMBeanExporter - Registering MessageChannel springCloudBusInput 2019-07-05 17:00:59.582 [main] INFO o.s.integration.monitor.IntegrationMBeanExporter - Located managed bean 'org.springframework.integration:type=MessageChannel,name=springCloudBusInput': registering with JMX server as MBean [org.springframework.integration:type=MessageChannel,name=springCloudBusInput] 2019-07-05 17:00:59.624 [main] INFO o.s.integration.monitor.IntegrationMBeanExporter - Registering MessageChannel springCloudBusOutput 2019-07-05 17:00:59.627 [main] INFO o.s.integration.monitor.IntegrationMBeanExporter - Located managed bean 'org.springframework.integration:type=MessageChannel,name=springCloudBusOutput': registering with JMX server as MBean [org.springframework.integration:type=MessageChannel,name=springCloudBusOutput] 2019-07-05 17:00:59.633 [main] INFO o.s.integration.monitor.IntegrationMBeanExporter - Registering MessageChannel nullChannel 2019-07-05 17:00:59.636 [main] INFO o.s.integration.monitor.IntegrationMBeanExporter - Located managed bean 'org.springframework.integration:type=MessageChannel,name=nullChannel': registering with JMX server as MBean [org.springframework.integration:type=MessageChannel,name=nullChannel] 2019-07-05 17:00:59.648 [main] INFO o.s.integration.monitor.IntegrationMBeanExporter - Registering MessageHandler errorLogger 2019-07-05 17:00:59.651 [main] INFO o.s.integration.monitor.IntegrationMBeanExporter - Located managed bean 'org.springframework.integration:type=MessageHandler,name=errorLogger,bean=internal': registering with JMX server as MBean [org.springframework.integration:type=MessageHandler,name=errorLogger,bean=internal] 2019-07-05 17:00:59.720 [main] INFO o.s.integration.channel.DirectChannel - Channel 'eam-spc-1.springCloudBusInput' has 1 subscriber(s). 2019-07-05 17:00:59.730 [main] INFO o.s.context.support.DefaultLifecycleProcessor - Starting beans in phase -2147482648 2019-07-05 17:01:00.487 [main] INFO o.s.c.c.client.ConfigServicePropertySourceLocator - Fetching config from server at : http://192.168.82.178:6671/ 2019-07-05 17:01:03.023 [main] INFO o.s.c.c.client.ConfigServicePropertySourceLocator - Located environment: name=eam-spc,mysql,mybatisplus, profiles=[dev], label=dev, version=8b7018c542b32543f9809a96710d141304ed5b98, state=null 2019-07-05 17:01:03.023 [main] INFO o.s.c.b.c.PropertySourceBootstrapConfiguration - Located property source: CompositePropertySource {name='configService', propertySources=[MapPropertySource {name='configClient'}, MapPropertySource {name='https://github.com/xlb/eam-cloud-conf/mybatisplus-dev.yml'}, MapPropertySource {name='https://github.com/xlb/eam-cloud-conf/mysql-dev.yml'}, MapPropertySource {name='https://github.com/xlb/eam-cloud-conf/application-dev.yml'}]} 2019-07-05 17:01:03.051 [main] INFO o.s.c.a.AnnotationConfigApplicationContext - Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@6a1b4854: startup date [Fri Jul 05 17:01:03 CST 2019]; parent: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@697a0948 2019-07-05 17:01:03.111 [main] INFO o.s.b.f.a.AutowiredAnnotationBeanPostProcessor - JSR-330 'javax.inject.Inject' annotation found and supported for autowiring 2019-07-05 17:01:03.202 [main] INFO o.s.context.support.GenericApplicationContext - Refreshing org.springframework.context.support.GenericApplicationContext@57def953: startup date [Fri Jul 05 17:01:03 CST 2019]; root of context hierarchy 2019-07-05 17:01:03.408 [main] INFO o.s.a.rabbit.connection.CachingConnectionFactory - Attempting to connect to: [localhost:5672] 2019-07-05 17:01:07.429 [main] INFO o.s.integration.channel.DirectChannel - Channel 'eam-spc-1.springCloudBusOutput' has 1 subscriber(s). 2019-07-05 17:01:07.431 [main] INFO o.s.context.support.DefaultLifecycleProcessor - Starting beans in phase 0 2019-07-05 17:01:07.436 [main] INFO o.s.cloud.netflix.eureka.InstanceInfoFactory - Setting initial instance status as: STARTING 2019-07-05 17:01:07.444 [main] INFO com.netflix.discovery.DiscoveryClient - Initializing Eureka in region us-east-1 2019-07-05 17:01:07.448 [main] INFO c.n.discovery.provider.DiscoveryJerseyProvider - Using JSON encoding codec LegacyJacksonJson 2019-07-05 17:01:07.448 [main] INFO c.n.discovery.provider.DiscoveryJerseyProvider - Using JSON decoding codec LegacyJacksonJson 2019-07-05 17:01:07.448 [main] INFO c.n.discovery.provider.DiscoveryJerseyProvider - Using XML encoding codec XStreamXml 2019-07-05 17:01:07.449 [main] INFO c.n.discovery.provider.DiscoveryJerseyProvider - Using XML decoding codec XStreamXml 2019-07-05 17:01:07.636 [main] INFO c.n.d.shared.resolver.aws.ConfigClusterResolver - Resolving eureka endpoints via configuration 2019-07-05 17:01:07.638 [main] INFO com.netflix.discovery.DiscoveryClient - Disable delta property : false 2019-07-05 17:01:07.638 [main] INFO com.netflix.discovery.DiscoveryClient - Single vip registry refresh property : null 2019-07-05 17:01:07.639 [main] INFO com.netflix.discovery.DiscoveryClient - Force full registry fetch : false 2019-07-05 17:01:07.639 [main] INFO com.netflix.discovery.DiscoveryClient - Application is null : false 2019-07-05 17:01:07.639 [main] INFO com.netflix.discovery.DiscoveryClient - Registered Applications size is zero : true 2019-07-05 17:01:07.639 [main] INFO com.netflix.discovery.DiscoveryClient - Application version is -1: true 2019-07-05 17:01:07.639 [main] INFO com.netflix.discovery.DiscoveryClient - Getting all instance registry info from the eureka server 2019-07-05 17:01:07.653 [main] INFO com.netflix.discovery.DiscoveryClient - The response status is 200 2019-07-05 17:01:07.655 [main] INFO com.netflix.discovery.DiscoveryClient - Starting heartbeat executor: renew interval is: 30 2019-07-05 17:01:07.661 [main] INFO com.netflix.discovery.InstanceInfoReplicator - InstanceInfoReplicator onDemand update allowed rate per min is 4 2019-07-05 17:01:07.665 [main] INFO com.netflix.discovery.DiscoveryClient - Discovery Client initialized at timestamp 1562317267665 with initial instances count: 11 2019-07-05 17:01:07.716 [main] INFO o.s.c.n.e.serviceregistry.EurekaServiceRegistry - Registering application eam-spc with eureka with status UP 2019-07-05 17:01:07.724 [main] INFO com.netflix.discovery.DiscoveryClient - Saw local status change event StatusChangeEvent [timestamp=1562317267722, current=UP, previous=STARTING] 2019-07-05 17:01:07.736 [DiscoveryClient-InstanceInfoReplicator-0] INFO com.netflix.discovery.DiscoveryClient - DiscoveryClient_EAM-SPC/YQ-ZN-125.sunnyoptical.com:eam-spc:9301: registering service... 2019-07-05 17:01:07.741 [main] INFO o.s.integration.endpoint.EventDrivenConsumer - Adding {logging-channel-adapter:_org.springframework.integration.errorLogger} as a subscriber to the 'errorChannel' channel 2019-07-05 17:01:07.741 [main] INFO o.s.integration.channel.PublishSubscribeChannel - Channel 'eam-spc-1.errorChannel' has 1 subscriber(s). 2019-07-05 17:01:07.741 [main] INFO o.s.integration.endpoint.EventDrivenConsumer - started _org.springframework.integration.errorLogger 2019-07-05 17:01:07.741 [main] INFO o.s.context.support.DefaultLifecycleProcessor - Starting beans in phase 2147482647 2019-07-05 17:01:07.794 [main] INFO o.s.c.s.b.r.p.RabbitExchangeQueueProvisioner - declaring queue for inbound: springCloudBus.anonymous.xrOMYrU1Qo6bAmYDenXamA, bound to: springCloudBus 2019-07-05 17:01:07.795 [main] INFO o.s.a.rabbit.connection.CachingConnectionFactory - Attempting to connect to: [localhost:5672] 2019-07-05 17:01:07.839 [DiscoveryClient-InstanceInfoReplicator-0] INFO com.netflix.discovery.DiscoveryClient - DiscoveryClient_EAM-SPC/YQ-ZN-125.sunnyoptical.com:eam-spc:9301 - registration status: 204 2019-07-05 17:01:11.821 [main] INFO o.s.a.rabbit.connection.CachingConnectionFactory - Attempting to connect to: [localhost:5672] 2019-07-05 17:01:15.842 [main] INFO o.s.a.rabbit.connection.CachingConnectionFactory - Attempting to connect to: [localhost:5672] 2019-07-05 17:01:19.866 [main] INFO o.s.cloud.stream.binder.BinderErrorChannel - Channel 'eam-spc-1-1.springCloudBus.anonymous.xrOMYrU1Qo6bAmYDenXamA.errors' has 1 subscriber(s). 2019-07-05 17:01:19.867 [main] INFO o.s.cloud.stream.binder.BinderErrorChannel - Channel 'eam-spc-1-1.springCloudBus.anonymous.xrOMYrU1Qo6bAmYDenXamA.errors' has 2 subscriber(s). 2019-07-05 17:01:19.881 [springCloudBus.anonymous.xrOMYrU1Qo6bAmYDenXamA-1] INFO o.s.a.rabbit.connection.CachingConnectionFactory - Attempting to connect to: [localhost:5672] 2019-07-05 17:01:23.890 [main] INFO o.s.i.amqp.inbound.AmqpInboundChannelAdapter - started inbound.springCloudBus.anonymous.xrOMYrU1Qo6bAmYDenXamA 2019-07-05 17:01:23.892 [main] INFO o.s.context.support.DefaultLifecycleProcessor - Starting beans in phase 2147483647 2019-07-05 17:01:23.926 [main] INFO org.apache.coyote.http11.Http11NioProtocol - Starting ProtocolHandler ["http-nio-9301"] 2019-07-05 17:01:23.944 [main] INFO org.apache.tomcat.util.net.NioSelectorPool - Using a shared selector for servlet write/read 2019-07-05 17:01:24.184 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat started on port(s): 9301 (http) with context path '' 2019-07-05 17:01:24.186 [main] INFO o.s.c.n.e.s.EurekaAutoServiceRegistration - Updating port to 9301 2019-07-05 17:01:24.188 [main] INFO com.soptop.eam.spc.EamSpcApplication - Started EamSpcApplication in 53.454 seconds (JVM running for 54.879) ` thanks a lot

ryanjbaxter commented 5 years ago

Please learn how to format code on GitHub.

Please try with Finchley.SR3 or Greenwich.SR2. If you can reproduce the problem then please provide a sample.

xlb commented 5 years ago

Please learn how to format code on GitHub.

Please try with Finchley.SR3 or Greenwich.SR2. If you can reproduce the problem then please provide a sample. i have put a simple demo on github. https://github.com/xlb/springcloud_demo.git

TYsewyn commented 5 years ago

This is normal. Spring Cloud Stream is used in order to setup the binding between your application and the message broker, in your case RabbitMQ. Behind the scenes Spring Cloud Stream is creating a new context to create all the necessary beans for you so you can use those to send and receive messages from the broker. When you see Fetching config from server at : for the second time, it's actually being logged from the second context which is created by Spring Cloud Stream.

xlb commented 5 years ago

This is normal. Spring Cloud Stream is used in order to setup the binding between your application and the message broker, in your case RabbitMQ. Behind the scenes Spring Cloud Stream is creating a new context to create all the necessary beans for you so you can use those to send and receive messages from the broker. When you see Fetching config from server at : for the second time, it's actually being logged from the second context which is created by Spring Cloud Stream.

thanks a lot!