DRYD-2233: Update Resteasy Configuration - #583
Open
mikejritter wants to merge 3 commits into
Open
mikejritter wants to merge 3 commits into
mikejritter wants to merge 3 commits into
Conversation
This allows us to perform the tasks done by CSpaceResteasyBoostrap which are a mix of updating the Resteasy context and post-init tasks.
Contributor
Author
|
Tested an exception being thrown from CSpaceRestasyBoostrap and confirmed it will cause the webapp startup to halt as expected. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this do?
This updates our Resteasy deployment configuration so that we only instantiate our Application class a single time:
Why are we doing this? (with JIRA link)
Jira: https://collectionspace.atlassian.net/browse/DRYD-2233
Using multiple deployment strategies causes the application to misbehave in subtle ways. So far it hasn't impacted runtime, but when adding Micrometer it was causing an exception to occur when scraping the metric registry.
The preference toward the servlet initializer and
javax.ws.rs.core.Applicationcomes from looking at the resteasy documentation, as it frequently mentionsThis section is pretty much deprecated if you are using a Servlet 3.0 container or higher. For running the CSpaceResteasyBoostrap post-init tasks, multiple ways of running were tried (e.g. as a ServletContextListener), but the requirement of having the ResteasyDeployment object available (and as such, the CollectionSpaceJaxRsApplication) meant that options were limited. The result of this was using a Feature even though it does not exactly match up with its intended use.How should this be tested? Do these changes have associated tests?
I'm not entirely sure how this should be tested, the easiest might be to add some basic logging into CollectionSpaceJaxRsApplication and test that you can see it, e.g.:
Otherwise, build CollectionSpace and run the integration tests against the server.
Dependencies for merging? Releasing to production?
Testing should be done if any of the startup tasks fail to ensure the server startup does not continue.
Has the application documentation been updated for these changes?
No. I don't know if we have any technical docs on how Resteasy is configured in CollectionSpace.
Did someone actually run this code to verify it works?
@mikejritter ran the integration tests locally
Have any new security vulnerabilities been handled?
n/a