question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support externalized configuration (e.g. changing server.port externally)

See original GitHub issue

Hi.

It seems that properties like ServerProperties are simply created with constructor: https://github.com/spring-projects/spring-fu/blob/04b317621a88c271e573c84409d89d016f4344c7/jafu/src/main/java/org/springframework/fu/jafu/web/WebFluxServerDsl.java#L51

While “classic” Spring Boot apps create them with Spring Boot’s configuration system, which uses Binder, something like:

binder.bind("server", ServerProperties.class).orElseGet(ServerProperties::new);

Please consider using Binder for them to allow externalized configuration (e.g. changing server.port externally)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

1reaction
sdeleuzecommented, Feb 16, 2019

For now you can use environnement variables that will be evaluated dynamicaly during startup.

0reactions
bsideupcommented, Jul 31, 2020

@sdeleuze still an issue, had to workaround with:

app.enable(WebFluxServerDsl.webFlux(dsl -> {
    try {
        var serverPropertiesField = WebFluxServerDsl.class.getDeclaredField("serverProperties");
        serverPropertiesField.setAccessible(true);
        serverPropertiesField.set(dsl, Binder.get(app.env()).bindOrCreate("server", ServerProperties.class));
    } catch (IllegalAccessException | NoSuchFieldException e) {
        throw new RuntimeException(e);
    }
}));
Read more comments on GitHub >

github_iconTop Results From Across the Web

21. Externalized Configuration - Spring
Spring Boot likes you to externalize your configuration so you can work ... e.g. --server.port=9000 ) to a property and add it to...
Read more >
Externalizing Application Configuration With Spring Cloud ...
In this article, we would be looking at how we can externalize application configuration using Spring Cloud Config.
Read more >
How to configure port for a Spring Boot application
set server.port=8080 in application properties. this configuration is in ServerProperties.class class under org.springframework.boot.autoconfigure.web ...
Read more >
External Configuration Data in Spring - Spring Framework Guru
If we want to connect to the production environment we must pass through the development environment first. This implies that as we develop...
Read more >
External HTTP(S) Load Balancing overview - Google Cloud
An external forwarding rule specifies an external IP address, port, ... For an example showing how to set up a load balancer with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found