Is your feature request related to a problem? Please describe. We need to serve properties and other raw files to applications and want to group them by directory, Eg:
- application1
- properties.yaml
- cert.crt
- template.pdf
- application2
- properties.yaml
The issue we are having is that when the repository is updated, application1 is not notified of the change because only the file name is used to determine the destination application.
Describe the solution you'd like We would need something to allow us to use the path to determine the target application to be notified
Describe alternatives you've considered Maybe allow customizing the application extracted based on the repo change
Comment From: ryanjbaxter
So only application2 is being notified?
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.
Comment From: mrodal
Thanks for the quick response
None of the applications are notified. For example if we change application1/template.pdf
, the event that config-monitor propagates is for application template
, and not for application1
.
Looking at the code we can see that the method guessServiceName
in PropertyPathEndpoint extracts the filename and uses it for the event.
The documentation mentions here that
The search locations can contain placeholders for {application}, {profile}, and {label}. In this way, you can segregate the directories in the path and choose a strategy that makes sense for you (such as subdirectory per application or subdirectory per profile).
But we couldnt make it work that way
Comment From: ryanjbaxter
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.
Comment From: mrodal
Here's the sample: spring cloud config.zip To test it you can use the docker-compose for kafka and then running the application
This is the config structure in the sample:
Here are the kafka events produced when some files change:
You can see that application1 is not in destinationService
for the changes to application1/properties-dev.yaml
nor application1/cert.crt
, only for the file with the application name in the file name. And as mentioned before, we would like application1
to be notified for any change in the files inside application1/*
application1/application1-properties-dev.yaml
application1/properties-dev.yaml
application1/cert.crt
Comment From: ryanjbaxter
I ran the docker-compose file and then started the app in my IDE but the app wouldn't start
Comment From: spring-cloud-issues
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.
Comment From: spring-cloud-issues
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.