I'm using spring cloud version 2021.0.1 and I set a gitlab webhook to trigger the refresh of application configs with spring cloud config monitor.
(The application has enabled the profile dev)
And I found that when I edited the config file in git like foo.yml , the monitor triggered a refresh of application foo, but when I edited the file foo-dev.yml, the refresh didn't happen.
I traced to find the config server do sent a RefreshRemoteApplicationEvent to spring cloud bus but with destination foo:dev. And I checked the doc of spring cloud bus, it says:
The default value of the ID is constructed in the form of
app:index:id, where: app is the vcap.application.name, if it exists, or spring.application.name index is the vcap.application.instance_index, if it exists, spring.application.index, local.server.port, server.port, or 0 (in that order). id is the vcap.application.instance_id, if it exists, or a random value.
so the correct destination should be foo:8080 or just foo, the profile name should not appear in the destination address.
Comment From: ryanjbaxter
Why would an instance without that profile enabled be interested in a chance in that configuration file?
Comment From: woshikid
The instance have enabled the profile "dev", and it refreshes when "foo.yml" changes but not on "foo-dev.yml".
Comment From: ryanjbaxter
So if you have two instances of foo running, one has the dev profile enabled and you edit foo.yaml does both instances get notifications?
And if you edit foo-dev.yaml will neither app instance receive a notification or will only the app without the dev profile enabled receive a notification?
Comment From: woshikid
If I edit foo.yaml both instances get notifications.
And if I edit foo-dev.yaml then neither app instance receive a notification.
Comment From: ryanjbaxter
I think this is the same issue as https://github.com/spring-cloud/spring-cloud-config/issues/1884, would you agree?
Comment From: woshikid
Yes, I think they are the same. And I have made a PR #2139 try to fix this.