Programmatically configure `Flags` via SPI
See original GitHub issueThe default value of some Flags could be changed by only JVM -Dcom.linecorp.armeria.XXX option such as -Dcom.linecorp.armeria.verboseSocketExceptions=true.
New options are constantly added to Flags according to various requirements and environments. Consequently, users find it difficult to override many options only via JVM options.
They may not want to frequently fix the options in their CI/CD tools.
If we provide an SPI interface and let users programmatically override the default value by implementing a configuration interface. Users can take advantage of the benefits of reviewing the properties in the PR and managing it in the source set.
The following priority could be applied to the new configuration mechanism.
- Give JVM options the highest priority.
- If a JVM option is not specified, checks the value in the configuration provided via SPI
- Neither is set, the sensible default defined in
Flagswill be used.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6 (6 by maintainers)
Top Results From Across the Web
4.2. Programmatically Configure the Persistence SPI Red Hat Data ...
Configure the Single File Store via the Persistence SPI ... Programmatic configurations can only be used with Red Hat JBoss Data Grid's Library...
Read more >SPI userspace API - The Linux Kernel documentation
SPI devices have a limited userspace API, supporting basic half-duplex read() and write() access to SPI slave devices. Using ioctl() requests, full duplex ......
Read more >Class ConnectionFactories - R2DBC
This utility provides runtime discovery of R2DBC implementations that are available through the class path. A ConnectionFactory can be obtained in two ways:...
Read more >STM32H7-Peripheral-Serial Peripheral interface (SPI)
peripheral's configuration. There are four I/O signals associated with the SPI peripheral. If required, the peripheral can keep control over the associated ...
Read more >Creating Extensible Applications (The Java™ Tutorials > The ...
The SPI defines the classes and methods available to your application. Service Provider: Implements the SPI. An application with extensible services enable ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

System properties are loaded once when
Flagsis initialized. So@ClearSystemPropertyand@SetSystemPropertydo not effectively change the default values ofFlags. We can use a custom class loader to re-evaluate the system properties. https://github.com/line/armeria/blob/4edffc8c11bd74665d652a1fd108d6a0307b6733/core/src/test/java/com/linecorp/armeria/common/FlagsTest.java#L92It is OK to exclude the deprecated flags from
ArmeriaOptions.I was thinking of the first approach in order to easily override the default options. For example:
The API consistency between
FlagandArmeriaOptionscan be ensured with a test using reflection.