moved "property" calls on Jersey APIs #1309
Open
+27
−50
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.
Mutating the client (which property calls do) after creation, changes the ClientConfig mode to RequestScoped. This forces Jersey to reinitialize the injection scope with each request, which degrades performance when many API calls are made
Running the client with a profiler led me down the rabbit hole of, "why is Jersey calling
initRuntimeon theClientConfig$Statefor each request". This task is slow and requires the creation of a new InjectionManager for each request. The calls to set the redirect and timeout properties made ininvocationwere what was doing it. It did not look like those needed to happen with each invocation, and instead could be done during client initialization so that Jersey would re-use the config for subsequent requests. Our project uses 5.x because we are stuck on java 8 so I made the change there. Let me know what I need to do to actually get this change approved and released. Thanks!