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

Spring Config support #5662

Closed
1 task
paulrobinson opened this issue Nov 21, 2019 · 13 comments · Fixed by #7130
Closed
1 task

Spring Config support #5662

paulrobinson opened this issue Nov 21, 2019 · 13 comments · Fixed by #7130
Labels
kind/epic Large issue with links to sub-issues

Comments

@paulrobinson
Copy link
Contributor

Description

We need to see how much of Spring Config make sense. Do we want to add support for Config Server both as the server and as a client?

The idea for this came from the Micronaut vs Quarkus talk at Devoxx where the speaker mentioned that Micronaut could work well in environments where Spring Config Server is being used

For reference: https://github.com/vert-x3/vertx-config/tree/master/vertx-config-spring-config-server

Discusion

From @cescoffier

So first, using spring config server is not limited to spring. For vert.x you configure a vert.x app.

Then, we need to carefully think about the update strategy. Do we really want to be able to push config update? It's a bit against "immutable infra" and the 12-factors approach.

So, we could, for example, imagine retrieving the configuration at startup time (not at build time, but having a recorder doing the retrieval) and populating the config into the app config. However, the big unknown is whether or not we have the hook to do that early enough in the startup process (because it must be the very first thing, however, it may need some (not necessary build time) config items. It's a bit a chicken and egg problem.

Anyway, the approach would be to expose a config source doing the retrieval.

Analysis

(links to analysis docs containing architecture design work, requirements gathering, etc)

Tasks

  • Checklist of sub tasks goes here, represented as links to GitHub issues
@paulrobinson paulrobinson added the kind/epic Large issue with links to sub-issues label Nov 21, 2019
@kenfinnigan
Copy link
Member

This also ties into the discussions around "dynamic config" for MP Config and SmallRye Config, and how far down that road we want to go

@geoand
Copy link
Contributor

geoand commented Nov 26, 2019

@kenfinnigan have things changed on the Smallrye side with the latest big changes to configuration?

@kenfinnigan
Copy link
Member

changed in what sense?

the current situation is that dynamic config is still not really supported directly

@geoand
Copy link
Contributor

geoand commented Nov 26, 2019

That answers my question :).

I was basically wondering if now have dynamic config support

@kenfinnigan
Copy link
Member

Depending on the ConfigSource its possible to essentially have dynamic by using:

@Inject
@ConfigProperty(name="myprj.some.dynamic.timeout", defaultValue="100")
private javax.inject.Provider<Long> timeout;

and calling timeout.get() whenever you want a value.

If the ConfigSource caches values, then this won't get the latest

@geoand
Copy link
Contributor

geoand commented Nov 26, 2019

Great info thanks!

How about the ability to add a config source based on some property? I am thinking that for a ConfigMapConfigSource for example we need at runtime to know the Kubernete API URL.

@kenfinnigan
Copy link
Member

Do you mean enabling a ConfigSource based on a property, or the ability to have a property be used to construct a ConfigSource that uses it?

@geoand
Copy link
Contributor

geoand commented Nov 26, 2019

Closer to the latter.
Basically I am thinking that we need to be able to create a ConfigSource using some property (not from the same ConfigSource).
For example when constructing a ConfigMapConfigSource you would need to know the Kubernetes API server you are targetting.
I am thinking that the property which is a "dependency" for creating ConfigMapConfigSource for example might be in some other ConfigSource

@kenfinnigan
Copy link
Member

Ah ok, behavior like that is currently not defined in the spec.

However, we're going to explore an implementation to do something like that in SmallRye Config to hopefully get it in the spec

@geoand
Copy link
Contributor

geoand commented Nov 26, 2019

That's cool, thanks for the info!

I'll keep an eye out for it

@geoand
Copy link
Contributor

geoand commented Dec 5, 2019

@kenfinnigan I am assuming you were referring to this issue?

@kenfinnigan
Copy link
Member

Yes

@geoand
Copy link
Contributor

geoand commented Feb 11, 2020

A native implementation of bootstrap config support was merged (#6913).

A first draft version of Spring Cloud Config Server support is in this draft PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/epic Large issue with links to sub-issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants