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

Set spring.cloud.bootstrap.enabled=true by default #582

Conversation

corneil
Copy link
Collaborator

@corneil corneil commented Nov 20, 2024

Set spring.cloud.bootstrap.enabled=true by default which allows the containers for the ITs to properly start.

@corneil corneil requested a review from onobc November 20, 2024 13:24
@corneil corneil force-pushed the corneil/disable-spring-cloud-config-by-default branch 2 times, most recently from ed093b5 to 315d0ed Compare November 20, 2024 16:25
Copy link
Collaborator

@onobc onobc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@corneil thanks for the PR. I have some concerns around the properties. PTAL.

@@ -17,34 +17,38 @@ popd > /dev/null
pushd applications/source > /dev/null
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are these changes related to "Disable spring.cloud.config by default"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to separate PR.

@@ -0,0 +1,3 @@
management.defaults.metrics.export.enabled=false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR desc says nothing about management.defaults.metrics.export.enabled. Why is this change in here?

We already disable the supported metrics registries via

<management.wavefront.metrics.export.enabled>false</management.wavefront.metrics.export.enabled>
<management.influx.metrics.export.enabled>false</management.influx.metrics.export.enabled>
<management.datadog.metrics.export.enabled>false</management.datadog.metrics.export.enabled>
<management.prometheus.metrics.export.enabled>false</management.prometheus.metrics.export.enabled>
<management.prometheus.metrics.export.rsocket.enabled>false</management.prometheus.metrics.export.rsocket.enabled>
.
I would prefer we remove this in this patch version.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The management.defaults.metrics.export.enabled is generated with you do a build on an app.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made change to root pom only.

Copy link
Collaborator

@onobc onobc Nov 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The management.defaults.metrics.export.enabled is generated with you do a build on an app.

It should not be. Where is it coming from? Strange, I see it locally as well.

@@ -0,0 +1,3 @@
management.defaults.metrics.export.enabled=false
spring.cloud.config.enabled=false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. To add a shared property we should do it here rather than proliferate a new application.yml in all of the apps.

  2. We do not want to add this property as it disables the config server for all apps. Explanation follows:

The reason you are seeing the failures is because

Spring Boot 2.4 introduced a new way to import configuration data via the spring.config.import property. This is now the default way to bind to Config Server.
Details.

However, the stream-apps currently use the Config First Bootstrap approach.

To enable this we have to do one of the following:

The first is the least intrusive approach.

What you have done here in this PR is disable the config server altogether for all apps - we do not want to do that.

The "Config First Bootstrap" approach is considered legacy and we should probably have got off of it in 5.0.0 but it is too late in the 5.0.x line to change this behavior. For now, lets simply add the spring.cloud.bootstrap.enabled=true to the shared application properties in

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting spring.cloud.bootstrap.enabled=true in the common properties seems to have done the trick.

Added spring.cloud.bootstrap.enabled=true to common properties for all applications generated.
@corneil corneil force-pushed the corneil/disable-spring-cloud-config-by-default branch from 315d0ed to 83f7ac9 Compare November 25, 2024 10:18
@corneil corneil requested a review from onobc November 25, 2024 10:23
Copy link
Collaborator

@onobc onobc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update @corneil - LGTM.

@onobc onobc changed the title Disable spring.cloud.config by default Set Set spring.cloud.bootstrap.enabled=true by default Nov 26, 2024
@onobc onobc changed the title Set Set spring.cloud.bootstrap.enabled=true by default Set spring.cloud.bootstrap.enabled=true by default Nov 26, 2024
@onobc onobc merged commit cbb4152 into spring-cloud:main Nov 26, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants