-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Apply some housekeeping to RESTEasy Reactive #32224
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 17 additions & 15 deletions
32
...ime/src/main/java/io/quarkus/resteasy/reactive/common/runtime/ResteasyReactiveConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,61 @@ | ||
package io.quarkus.resteasy.reactive.common.runtime; | ||
|
||
import io.quarkus.runtime.annotations.ConfigItem; | ||
import io.quarkus.runtime.annotations.ConfigPhase; | ||
import io.quarkus.runtime.annotations.ConfigRoot; | ||
import io.quarkus.runtime.configuration.MemorySize; | ||
import io.smallrye.common.annotation.Experimental; | ||
import io.smallrye.config.ConfigMapping; | ||
import io.smallrye.config.WithDefault; | ||
|
||
@ConfigRoot(phase = ConfigPhase.BUILD_AND_RUN_TIME_FIXED, name = "resteasy-reactive") | ||
public class ResteasyReactiveConfig { | ||
@ConfigMapping(prefix = "quarkus.resteasy-reactive") | ||
@ConfigRoot(phase = ConfigPhase.BUILD_AND_RUN_TIME_FIXED) | ||
public interface ResteasyReactiveConfig { | ||
|
||
/** | ||
* The amount of memory that can be used to buffer input before switching to | ||
* blocking IO. | ||
*/ | ||
@ConfigItem(defaultValue = "10k") | ||
public MemorySize inputBufferSize; | ||
@WithDefault("10k") | ||
MemorySize inputBufferSize(); | ||
|
||
/** | ||
* The size of the output stream response buffer. If a response is larger than this and no content-length | ||
* is provided then the request will be chunked. | ||
* | ||
* Larger values may give slight performance increases for large responses, at the expense of more memory usage. | ||
*/ | ||
@ConfigItem(defaultValue = "8191") | ||
public int outputBufferSize; | ||
@WithDefault("8191") | ||
int outputBufferSize(); | ||
|
||
/** | ||
* By default, we assume a default produced media type of "text/plain" | ||
* for String endpoint return types. If this is disabled, the default | ||
* produced media type will be "[text/plain, */*]" which is more | ||
* expensive due to negotiation. | ||
*/ | ||
@ConfigItem(defaultValue = "true") | ||
public boolean singleDefaultProduces; | ||
@WithDefault("true") | ||
boolean singleDefaultProduces(); | ||
|
||
/** | ||
* When one of the quarkus-resteasy-reactive-jackson or quarkus-resteasy-reactive-jsonb extension are active | ||
* and the result type of an endpoint is an application class or one of {@code Collection}, {@code List}, {@code Set} or | ||
* {@code Map}, | ||
* we assume the default return type is "application/json" if this configuration is enabled. | ||
*/ | ||
@ConfigItem(defaultValue = "true") | ||
@WithDefault("true") | ||
@Experimental("This flag has a high probability of going away in the future") | ||
public boolean defaultProduces; | ||
boolean defaultProduces(); | ||
|
||
/** | ||
* Whether annotations such `@IfBuildTimeProfile`, `@IfBuildTimeProperty` and friends will be taken | ||
* into account when used on JAX-RS classes. | ||
*/ | ||
@ConfigItem(defaultValue = "true") | ||
public boolean buildTimeConditionAware; | ||
@WithDefault("true") | ||
boolean buildTimeConditionAware(); | ||
|
||
/** | ||
* Whether duplicate endpoints should trigger error at startup | ||
*/ | ||
@ConfigItem(defaultValue = "true") | ||
public boolean failOnDuplicate; | ||
@WithDefault("true") | ||
boolean failOnDuplicate(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@radcortez in a lot of config groups, we have methods like
boolean isAnyPropertySet()
. By making the@ConfigItem
element not mandatory (or even not desirable), my understanding is that we will need a way to mark these methods as ignored from the config (and the doc)?Moving these methods outside of the interface will be counter productive as I'm pretty sure they will end up not being updated when we add new properties.
And I suppose we will have to make them default methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't simply making the method default be enough for Smallry Config to ignore them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea thus why I'm asking. But they also need to be ignored in the doc. Not sure if @radcortez already took that into account.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, default methods are ignored :)
I fixed that recently here: #31384