-
Notifications
You must be signed in to change notification settings - Fork 358
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
DHIS2-18568: allow Route response timeout to be customised #19872
base: master
Are you sure you want to change the base?
Conversation
cjmamo
commented
Feb 6, 2025
- Replaced blocking route HTTP client with non-blocking client to remove connection pool
- Allowing route response timeout to be customised
perf: use non-blocking WebClient instead of RestTemplate
tolerate HTTP errors in WebClient test: add test coverage for response timeout and HTTP errors
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/route/RouteService.java
Outdated
Show resolved
Hide resolved
use int instead of Integer for responseTimeout to remove null checks remove redundant annotations rename references use `Json.object` instead handcrafting JSON in RouteService
dhis-2/dhis-api/src/main/java/org/hisp/dhis/route/Route.java
Dismissed
Show dismissed
Hide dismissed
|
Instance deployed to https://dev.im.dhis2.org/pr-19872 |
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.
LGTM! Would be great to get one more review from the backend team
@@ -48,6 +48,7 @@ | |||
@EqualsAndHashCode(callSuper = true) | |||
@Accessors(chain = true) | |||
public class Route extends BaseIdentifiableObject implements MetadataObject { | |||
public static final String DEFAULT_RESPONSE_TIMEOUT_SECONDS = "5"; |
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.
FYI: You can declare the constant as an int
and use ""+DEFAULT_RESPONSE_TIMEOUT_SECONDS
in the annotation to turn it into a string.
throwable -> { | ||
JsonObject message = | ||
Json.object( | ||
jsonObjectBuilder -> |
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'd name this just obj
or object
because in the scope where the variable is valid it reads much better to pretend this is already an object. The "building" will happen implicitly at the end of the scope so it doesn't add anything to make the reader aware that the interface you are using is in fact a builder.