Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/monitor endpoint does not work with Spring Cloud Finchley.M9 #112

Closed
anthonyrm opened this issue Apr 9, 2018 · 8 comments
Closed

/monitor endpoint does not work with Spring Cloud Finchley.M9 #112

anthonyrm opened this issue Apr 9, 2018 · 8 comments

Comments

@anthonyrm
Copy link

Hello, I have created a config server and a config client with SpringBoot 2.0.1.RELEASE and Spring Cloud Finchley.M9.

I have added spring-cloud-config-monitor to call /monitor endpoint via webhook, however the config client does not refresh the configuration when the webhook is triggered.
I also have exposed the /actuator/bus-refresh endpoint to make local test and this works perfectly.

Config Server -> https://github.com/anthonyrm/spring-cloud-config-server
Config Client -> https://github.com/anthonyrm/spring-cloud-config-client
Config Data -> https://github.com/anthonyrm/ConfigData

Notes:

  • I have tested with Finchley.BUILD-SNAPSHOT version and does not work either.
  • When I use the Springboot 1.5.10.RELEASE and Spring cloud Edware.SR3 the webhook works perfectly.
@spencergibb
Copy link
Member

This isn't a problem with the bus. I just went through this the other day. Monitor has to try and derive the appname from the file. If your appname has dashes in it (like yours does config-client), it incorrectly derives the name config (the dashes are used for profiles), therefor config-client won't respond to a refresh addressed to config.

@gs-spadmanabhan
Copy link

I am also facing similar issue where the github webhook trigger is not placing the RefreshRemoteApplicationEvent in rabbitmq. My application name does not have a dash in it.

https://github.com/u-learn/rickle/tree/master/r-config-client
https://github.com/u-learn/rickle/blob/master/r-config-client/src/main/resources/bootstrap.properties
https://github.com/u-learn/rickle/tree/master/r-config-server

@gs-spadmanabhan
Copy link

gs-spadmanabhan commented Apr 19, 2018

@spencergibb the dashes in app name is getting added via spring cloud jars (yet to find from where) but here is the logs which I see (even though my app name is just a single word "rickle"). Can you please let us know how to correct this?

018-04-19 19:05:26.227  INFO 67226 --- [           main] o.s.a.r.c.CachingConnectionFactory       : Attempting to connect to: [localhost:5672]
2018-04-19 19:05:26.263  INFO 67226 --- [           main] o.s.a.r.c.CachingConnectionFactory       : Created new connection: rickle#0/SimpleConnection@1bec1589 [delegate=amqp://guest@127.0.0.1:5672/, localPort= 49997]
2018-04-19 19:05:26.312  INFO 67226 --- [           main] o.s.integration.channel.DirectChannel    : Channel 'rickle-1.springCloudBusOutput' has 1 subscriber(s).
2018-04-19 19:05:26.314  INFO 67226 --- [           main] o.s.c.support.DefaultLifecycleProcessor  : Starting beans in phase 0
2018-04-19 19:05:26.315  INFO 67226 --- [           main] o.s.c.c.m.FileMonitorConfiguration       : Not monitoring for local config changes
2018-04-19 19:05:26.315  INFO 67226 --- [           main] o.s.i.endpoint.EventDrivenConsumer       : Adding {logging-channel-adapter:_org.springframework.integration.errorLogger} as a subscriber to the 'errorChannel' channel
2018-04-19 19:05:26.315  INFO 67226 --- [           main] o.s.i.channel.PublishSubscribeChannel    : Channel 'rickle-1.errorChannel' has 1 subscriber(s).
2018-04-19 19:05:26.315  INFO 67226 --- [           main] o.s.i.endpoint.EventDrivenConsumer       : started _org.springframework.integration.errorLogger
2018-04-19 19:05:26.315  INFO 67226 --- [           main] o.s.c.support.DefaultLifecycleProcessor  : Starting beans in phase 2147482647
2018-04-19 19:05:26.315 DEBUG 67226 --- [           main] o.s.c.s.binding.BindableProxyFactory     : Binding inputs for :interface org.springframework.cloud.bus.SpringCloudBusClient
2018-04-19 19:05:26.315 DEBUG 67226 --- [           main] o.s.c.s.binding.BindableProxyFactory     : Binding :interface org.springframework.cloud.bus.SpringCloudBusClient:springCloudBusInput
2018-04-19 19:05:26.331  INFO 67226 --- [           main] c.s.b.r.p.RabbitExchangeQueueProvisioner : declaring queue for inbound: sunand.anonymous.1D6VdnJWQrqyyDVKPlvi4A, bound to: sunand
2018-04-19 19:05:26.352  INFO 67226 --- [           main] o.s.c.stream.binder.BinderErrorChannel   : Channel 'rickle-1-1.sunand.anonymous.1D6VdnJWQrqyyDVKPlvi4A.errors' has 1 subscriber(s).
2018-04-19 19:05:26.352  INFO 67226 --- [           main] o.s.c.stream.binder.BinderErrorChannel   : Channel 'rickle-1-1.sunand.anonymous.1D6VdnJWQrqyyDVKPlvi4A.errors' has 2 subscriber(s).
2018-04-19 19:05:26.370  INFO 67226 --- [           main] o.s.i.a.i.AmqpInboundChannelAdapter      : started inbound.sunand.anonymous.1D6VdnJWQrqyyDVKPlvi4A
2018-04-19 19:05:26.372  INFO 67226 --- [           main] o.s.c.support.DefaultLifecycleProcessor  : Starting beans in phase 2147483647
2018-04-19 19:05:26.404  INFO 67226 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8888 (http) with context path ''

@gs-spadmanabhan
Copy link

gs-spadmanabhan commented Apr 19, 2018

Hi @spencergibb , Upon closer look at logs I found that ApplicationContext is getting refreshed at the boot up of application itself, below are the very first lines which got printed when I started the application,

/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/libinstrument.dylib (0x10c9374e0). One of the two will be used. Which one is undefined.
2018-04-19 20:22:20.894  INFO 85827 --- [           main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@702657cc: startup date [Thu Apr 19 20:22:20 IST 2018]; root of context hierarchy
2018-04-19 20:22:21.215  INFO 85827 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'configurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$5b9c5b6e] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

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

This changes the application id from rickle to rickle-1 (since the application creates a child id, ContextId.createChild())

@spencergibb
Copy link
Member

I think has been fixed in later releases, can you verify.

@spring-projects-issues
Copy link

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

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.

@cristallo
Copy link

cristallo commented Apr 18, 2019

Hi,
I have the same problem and I can provide some more data. The problem seems to lie in registering the client in the broker used. Using Spring Boot 1.5.6 and Spring Cloud Dalston.SR4 a client named "client-service" with an active profile "zone1" registers on the channel 'client-service: zone1: 9181.springCloudBusInput'. This is the client log: 2019-04-17 17: 56: 30.479 INFO 3848 --- [main] osintegration.channel.DirectChannel: Channel 'client-service: zone1: 9181.springCloudBusInput' has 1 subscriber (s) .

Using Spring Boot 2.0.6 and Spring Cloud Finchley.RELEASE the same client with the same profile registers on the 'client-service-1.springCloudBusInput' channel. This is the client log: 2019-04-17 17: 22: 31.028 INFO 2792 --- [main] o.s.integration.channel.DirectChannel: Channel 'client-service-1.springCloudBusInput' has 1 subscriber (s). The problem is that the Config Server continues to write the refresh on the client-service channel: zone1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants