-
Notifications
You must be signed in to change notification settings - Fork 899
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
Programmatically configured options on ServerBuilder
are overridden by ArmeriaSettings
#5009
Comments
ServerBuilder
are overridden by ArmeriaSettings
ServerBuilder
are overridden by ArmeriaSettings
Some users may not want to override the values provided by If armeria:
overridable: true @KarboniteKream Can this approach meet your requirements? |
So if
Overall I thought it is reasonable that configuration properties are overridden programmatically. I'm curious what kind of scenario/properties users may not want to override 😄 |
If I wrote a novel... Let's say an
Good point. Thinking about it again, it seems that it is sufficient to modify to apply |
I agree this may be a case. |
That would work, but I agree with @jrhee17. I would expect About That's just my two cents. I'll trust your final decision, since you have more experience in this area. |
@KarboniteKream My apologies for the delay in addressing this. I have created a PR to resolve this issue. PTAL. 🙇 |
…Settings` (line#5692) Motivation: The properties from `ArmeriaSettings` should be considered as default values and should be overridden by the beans that implement `ArmeriaServerConfigurator`. This ensures that custom configurations provided by `ArmeriaServerConfigurator` take precedence over the default settings. Modifications: - Adjusted the order of configuration application so that `ArmeriaServerConfigurator` is applied last, ensuring it can override properties set by `ArmeriaSettings`. Result: - `ArmeriaServerConfigurator` now properly overrides the properties set by `ArmeriaSettings`. - Close line#5009
When using the
spring-boot{2,3}-autoconfigure
library, the providedArmeriaSettings
autoconfiguration is overridding any user-supplied configuration in code.For example, when using
builder.gracefulShutdownTimeout(x, y)
, the provided values are applied toServerBuilder
, but before the server is built, they're overwritten by the autoconfiguration classes.This can be reproduced by setting a breakpoint here:
armeria/core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
Lines 824 to 825 in 2e50636
Then, you should set a custom value here:
armeria/examples/spring-boot-minimal/src/main/java/example/springframework/boot/minimal/HelloConfiguration.java
Lines 21 to 24 in 2e50636
Once the application is started, you can observe the provided value being overriden by
ArmeriaSettings
.As a temporary workaround, you can inject
ArmeriaSettings
and usesetGracefulShutdownQuietPeriodMillis()
The text was updated successfully, but these errors were encountered: