Skip to content
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

chore(vertx): upgrade vertx 3->4 #949

Merged
merged 15 commits into from
May 31, 2022
Merged

Conversation

andrewazores
Copy link
Member

@andrewazores andrewazores commented May 18, 2022

Fixes #453

This is a very large looking PR, but it only does a couple of things. They just touched a lot of places.

First it upgrades the Vert.x version in the pom.xml from a 3.x to 4.3.0 (latest). This comes with a change moving the HttpStatusException class to a different package and renaming it HttpException, as well as making it final. This is the bulk of the file touches in the PR, because we were using HttpStatusException nearly everywhere. It moved from Vert.x "internal" package to a public API one at Vert.x version 4.1.0, so this shouldn't happen to us again. This necessitated a small adjustment to the ApiException handling in various places as well, since that can no longer subclass the final class HttpException.

Next it makes a few small adjustments to get functionality working again due to various changes in the 4.x line. For example, the Vert.x-GraphQL GraphQLHandler is no longer a BodyHandler on its own, so I had to add a specific BodyHandler instance in front of that one like we have elsewhere. The GraphQL Scalar type was also deprecated, removed, and replaced by one in the extended-scalars package.

Next it turns a few more pieces into Verticles. For the most part this isn't actually achieving anything at this point, since these new pieces aren't taking much advantage of Vert.x event loop architecture, but this opens the door to refactor them better in the future.

Finally it replaces various (Scheduled)ExecutorService usages with vertx.setTimer() and vertx.setPeriodic. This lets us make better use of the existing Vert.x worker thread pool, rather than maintaining our own competing thread pool(s). Unlikely to have serious impact here yet, but it allows us to refactor things to make better use of the event loop and reactive/non-blocking architecture in the future.

@andrewazores andrewazores added dependencies Pull requests that update a dependency file chore Refactor, rename, cleanup, etc. labels May 18, 2022
@andrewazores andrewazores marked this pull request as ready for review May 18, 2022 22:39
@andrewazores andrewazores requested review from ebaron, hareetd and jan-law and removed request for ebaron May 18, 2022 22:40
@ebaron
Copy link
Member

ebaron commented May 25, 2022

Would it be a substantial change to use vertx 4.2.5 instead of 4.3? This would allow us to sync with Quarkus 2.7: https://github.com/quarkusio/quarkus/blob/2733bae7cb7ded76d324b41a3a9f4e81b89ee122/bom/application/pom.xml#L114

@andrewazores
Copy link
Member Author

4.2.5 would probably work with no changes. The only difference I can anticipate is that the BodyHandler sitting in front of the GraphQLPostHandler would become redundant, and the changed location for some of the extended GraphQL scalar types might not be needed.

https://github.com/vert-x3/wiki/wiki/4.3.0-Release-Notes

I can try a 4.2.5 build and see what breaks, if anything.

@andrewazores
Copy link
Member Author

@ebaron latest push is downgrade to vertx 4.2.5 now. The GraphQL stuff was actually all fine, the only required changes were to go back to the RoutingContext.fileUploads() having return type of Set rather than List, so that broke some test compilations because the mock signatures didn't match. Otherwise it looks fine.

Copy link
Contributor

@hareetd hareetd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code changes look good. Tested it out and Rules are working well but Recording Stopped notifications aren't being issued (see my comment above).

@andrewazores andrewazores merged commit 4ad1c63 into cryostatio:main May 31, 2022
@andrewazores andrewazores deleted the vertx4 branch May 31, 2022 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Refactor, rename, cleanup, etc. dependencies Pull requests that update a dependency file
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Task] Update to Vert.x 4
4 participants