-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Store properties in db instead of git #203
Comments
@K-RAD pull requests are welcome. We aren't planning it at the moment. There are also other implementations that don't use config server: spring-cloud-consul and spring-cloud-zookeeper. Some of the reasons we chose git are that it already implements versioning and history, which a db doesn't have by default. Your business may not know git, but in general, most developers do. |
Hi, Spencer I am facing the need to implement a database backend for Spring-Cloud-Config. Up until today I have reviewed the implementation of NativeEnvironmentRepository in the spring cloud-config-server project , and looks that the key component for this purpose is the ConfigFileApplicationListener so would it be a good approach to implement that listener but accessing a DB? Another way that occurred to me was to implement the PropertySourceLocator with access to a DB... however, how this would update the environment variables if any changes during the application runtime? Any guidance or hint on how to proceed or even if this would be the best approach? Thanks |
|
…implementation.
…implementation.
…implementation.
Hi there, is there any guide how to create a custom environment repository??? It would be awesome to have an example, for instance with Map as environment storage. |
There is no guide, but there are plenty of examples in the source code |
You know, they are not simple, it shouldn't be hard to do. Actually I've found this - spring-attic/spring-cloud-config-server-mongodb@ecedae0#diff-b109c993c15a6bd4f1aceeb3716c7a85 (MongoDB EnvironmentRepository). And I read it like an example how to implement a custom implementation |
The |
|
@yangzii0920 yeap, I did it, it works, take a look at my test implementation - https://github.com/igor-dmitriev/spring-cloud-config-poc. |
@igor-dmitriev Had a look. Is it cloud config w custom environment repository? I actually wanted to ask if you have tried out the one with MongoDB that you found. |
@yangzii0920 exactly. I've just used that MongoDB implementation as an example to create my own custom one |
Hello everyone, I developed a project that implements a DbEnvironmentRepository using a SQL database
spring.profiles.active=db
Oracle example
4.1. table name must be: application-environment Oracle example: application: x-service
Any comment is welcome! Regards, |
Closed in e362f39. More features could be added (e.g. it's read only for now). But the basics are there, and I think that sets the bar for the contract (how to interpret the HTTP request and turn it into SQL). |
Does it mean that refresh event is not implemented yet? Are you planning to provide crud rest API that will trigger the refresh event after updating the DB ? |
Refresh is orthogonal. Posting to
Besides |
Hi guys- I have my config server pulling configurations from svn, works great, I have a need to add the jdbc config which I did based on the sample test cases. However, spring boot micoservice is not getting these configurations, the one that's listed in the table. Here is my condig server application yaml file:
Here is my Database:
sample values in the table:
and here is my client
This value is not set when its in the database, however, when I add it to the SVN repo, this value is set correctly. So it works when set in the svn yaml file but not when it's set in the database PROPERTIES table. Any help to resolve this issue would be much appreciated. |
@PaulGobin asking question on a closed issue isn't how we use the issue tracker. Probably best to ask questions on gitter or open a new issue if you think there's a bug. |
Sorry Spencer- Actually, just a quick comment, I reviewed the JdbcEnvironmentRepository code and I found my issue, the SQL I had set in the yaml file was SELECT APPLICATION, PROFILE, LABEL, KY , VALUE FROM PROPERTIES where APPLICATION=? and PROFILE=? and LABEL=? it should have been: thanks |
@spencergibb exist some way to provide the refreshscope to config server using DB's approach? |
Spring-Cloud-Config looks like a very interesting option and we're considering using it in our project.
However, what we don't like is the fact that the properties are stored on Git.
If they were stored in a database it would've been way better in our view. Git is less trackable, there's less security and permissions to push/change them there, it can be down more often than db and so on. Oh, and business knows db, not git.
Will this be available at some point?
The text was updated successfully, but these errors were encountered: