Migrate jetty-client to vertx-web-client
Migrated the HTTP client implementation from Jetty Client to Vert.x Web Client. This involved:
- Updating
pom.xmlto replacejetty-clientwithvertx-web-client. - Removing
getCookieStore()fromIHttpClientas it is not directly supported in the same way and wasn't widely used. - Creating
VertxHttpClientto hold the Vert.x instance and WebClient. - Updating
HttpClientModuleto configure the WebClient options (mapping pool size, timeouts, etc.) and produce theVertxHttpClientbean. - Rewriting
HttpClientWrapperto useWebClientfor request building and execution. It supports both synchronous (blocking) and asynchronous execution modes, preserving the existing interface contracts. - Ensuring
CompletableFutureis used to bridge the async Vert.x API to the synchronoussend()method. - Re-implementing a check for maximum response body size to prevent large payloads from causing issues, similar to the previous implementation.
- Verified changes with existing tests.
PR created automatically by Jules for task 9619466246744998612 started by @ginccc
Summary by CodeRabbit
-
Chores
- Switched the project HTTP client implementation to use the Vert.x Web Client.
-
Breaking Changes
- Cookie store/accessor removed from the HTTP client API; callers relying on cookie store will need adjustments.
βοΈ Tip: You can customize this high-level summary in your review settings.
π Jules, reporting for duty! I'm here to lend a hand with this pull request.
When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.
I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!
For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!
For security, I will only act on instructions from the user who triggered this task.
New to Jules? Learn more at jules.google/docs.
[!IMPORTANT]
Review skipped
Bot user detected.
To trigger a single review, invoke the
@coderabbitai reviewcommand.You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.
[!NOTE]
Other AI code review bot(s) detected
CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.
Walkthrough
Project HTTP client migrated from Jetty to Vert.x WebClient: dependency replaced, IHttpClient cookie-store accessor removed, and implementations refactored to use Vert.x APIs and WebClient for request/response handling.
Changes
| Cohort / File(s) | Summary |
|---|---|
Build Configurationpom.xml |
Replaced org.eclipse.jetty:jetty-client dependency with io.vertx:vertx-web-client and related Vert.x artifacts. |
HTTP Client Interfacesrc/main/java/ai/labs/eddi/engine/httpclient/IHttpClient.java |
Removed getCookieStore() method and the Jetty cookie-store import. |
DI / Modulesrc/main/java/ai/labs/eddi/engine/httpclient/bootstrap/HttpClientModule.java |
Provider changed to construct and return VertxHttpClient using Vertx + WebClient/WebClientOptions; removed Jetty lifecycle and executor wiring. |
HTTP Client Implementationsrc/main/java/ai/labs/eddi/engine/httpclient/impl/VertxHttpClient.java |
Renamed class from JettyHttpClient β VertxHttpClient; replaced Jetty fields with Vertx and WebClientSession fields; removed Jetty HttpClient usage. |
Wrapper / Request Handlingsrc/main/java/ai/labs/eddi/engine/httpclient/impl/HttpClientWrapper.java |
Reworked to use Vert.x HttpRequest<Buffer>/WebClient.requestAbs, adjust headers/auth/query/body handling, wrap async results into CompletableFuture<IResponse>, enforce max-response-size, and removed cookie-store accessor. |
Sequence Diagram(s)
sequenceDiagram
participant Client
participant HttpClientWrapper
participant VertxHttpClient
participant WebClient as Vert.x WebClient
participant Server
Client->>HttpClientWrapper: send(request)
HttpClientWrapper->>VertxHttpClient: newRequest(uri, method)
VertxHttpClient->>WebClient: requestAbs(uri)
Note right of HttpClientWrapper: build request (headers, auth, params, body)
HttpClientWrapper->>WebClient: send() (async)
WebClient->>Server: HTTP request
Server-->>WebClient: HTTP response
WebClient-->>HttpClientWrapper: async result
Note left of HttpClientWrapper: convert to IResponse\nenforce maxLength if set
HttpClientWrapper-->>Client: CompletableFuture<IResponse>
Estimated code review effort
π― 4 (Complex) | β±οΈ ~45 minutes
- Pay special attention to:
-
HttpClientWrapper.javaβ correctness of request mapping (headers, basic auth, query params), timeout conversion, body encoding, and max-length enforcement. -
HttpClientModule.javaβ Vert.x and WebClientOptions configuration, lifecycle and shutdown behavior. -
VertxHttpClient.javaβ class rename/field changes and any callers expecting previous class name or Jetty API. - Public API change: removal of
IHttpClient.getCookieStore()and any usages across the codebase.
-
Poem
π° I hopped from Jetty docks to Vert.x streams,
Async leaves rustle, web-client dreams,
Headers and queries now dance in queues,
Cookies unloaded β lighter news,
A rabbit cheers the new request hues. π₯
Pre-merge checks and finishing touches
β Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | β οΈ Warning | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. | You can run @coderabbitai generate docstrings to improve docstring coverage. |
β Passed checks (2 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | β Passed | Check skipped - CodeRabbitβs high-level summary is enabled. |
| Title check | β Passed | The title clearly and accurately summarizes the main objective of the changeset: migrating the HTTP client library from Jetty to Vert.x Web Client, which is the primary focus across all modified files. |
Comment @coderabbitai help to get the list of available commands and usage tips.
@coderabbitai review
β Actions performed
Review triggered.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
@coderabbitai review
Addressed feedback regarding version mismatch (reverted to managed version), blocking calls (using proper worker thread context where applicable), cookie support (added WebClientSession), and memory safety (added max response size check).
Skipped: Cannot respond to another bot.
@coderabbitai re review
@ginccc: I'll perform a full review of the PR changes migrating from Jetty Client to Vert.x Web Client.
β Actions performed
Full review triggered.
@coderabbitai re review
Addressed Copilot feedback: Removed unused parameter disableWWWAuthenticationValidation from HttpClientModule.
Skipped: Cannot respond to another bot.