-
Notifications
You must be signed in to change notification settings - Fork 582
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
Allow streaming apps to use custom datasources #4361
Allow streaming apps to use custom datasources #4361
Conversation
- In the docker-compose configuration, replace the datasource env. variables (e.g. like SPRING_DATASOURCE_URL) by Spring properties to allow the apps to override it. Resolves spring-cloud#4359
LGTM |
- SPRING_DATASOURCE_USERNAME=root | ||
- SPRING_DATASOURCE_PASSWORD=rootpw | ||
- SPRING_DATASOURCE_DRIVER_CLASS_NAME=org.postgresql.Driver | ||
- spring.datasource.url=jdbc:postgresql://postgres:5432/dataflow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tzolov The way I understood was that, the properties under environment
would always be ENV properties irrespective of the case. Can you help me understand how this works this way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ilayaperumalg , when you deploy an app you can set apps's own --spring.datasource.url
that would override the one coming form the Skipper. But if skipper uses env variables (e.g. SPRING_DATASOURCE_URL
) then apparently children's property is ignored in favor of the inherited env variable. I guess in boot the env. vars has precedence over properties.
The above behaviors observed by the local deployers used by the docker-compose configurations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a bit weird as it's still coming from a boot's property resolver which resolves from environment and thus format in it should not make any difference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets say that environment variables have SPRING_DATASOURCE_URL
and spring.datasource.url
a `XXX_XXX_XXX takes precedence. Then this may be a symptom of how local deployer is setting properties into environment variables using dot style so it would override that but not the normal underscore type. Running apps in a same container is not so supported scenario being testing. Maybe local deployer could be setup not to inherit those database values automatically?
We should fix the issue on a local deployer as those environment inherit settings were wrongly removed a long time ago. That would be a proper fix and possible compose config could then choose what to inherit into local processes. |
We have decided to apply the changes into |
Resolves #4359