EDDI icon indicating copy to clipboard operation
EDDI copied to clipboard

Migrate jetty-client to vertx-web-client

Open google-labs-jules[bot] opened this issue 5 months ago β€’ 10 comments

Migrated the HTTP client implementation from Jetty Client to Vert.x Web Client. This involved:

  • Updating pom.xml to replace jetty-client with vertx-web-client.
  • Removing getCookieStore() from IHttpClient as it is not directly supported in the same way and wasn't widely used.
  • Creating VertxHttpClient to hold the Vert.x instance and WebClient.
  • Updating HttpClientModule to configure the WebClient options (mapping pool size, timeouts, etc.) and produce the VertxHttpClient bean.
  • Rewriting HttpClientWrapper to use WebClient for request building and execution. It supports both synchronous (blocking) and asynchronous execution modes, preserving the existing interface contracts.
  • Ensuring CompletableFuture is used to bridge the async Vert.x API to the synchronous send() 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


This change is Reviewable

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.

google-labs-jules[bot] avatar Nov 21 '25 16:11 google-labs-jules[bot]

πŸ‘‹ 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.

google-labs-jules[bot] avatar Nov 21 '25 16:11 google-labs-jules[bot]

[!IMPORTANT]

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in 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 Configuration
pom.xml
Replaced org.eclipse.jetty:jetty-client dependency with io.vertx:vertx-web-client and related Vert.x artifacts.
HTTP Client Interface
src/main/java/ai/labs/eddi/engine/httpclient/IHttpClient.java
Removed getCookieStore() method and the Jetty cookie-store import.
DI / Module
src/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 Implementation
src/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 Handling
src/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[bot] avatar Nov 21 '25 16:11 coderabbitai[bot]

@coderabbitai review

ginccc avatar Nov 21 '25 16:11 ginccc

βœ… 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[bot] avatar Nov 21 '25 16:11 coderabbitai[bot]

@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).

google-labs-jules[bot] avatar Nov 22 '25 13:11 google-labs-jules[bot]

Skipped: Cannot respond to another bot.

coderabbitai[bot] avatar Nov 22 '25 13:11 coderabbitai[bot]

@coderabbitai re review

ginccc avatar Nov 22 '25 13:11 ginccc

@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[bot] avatar Nov 22 '25 13:11 coderabbitai[bot]

@coderabbitai re review

Addressed Copilot feedback: Removed unused parameter disableWWWAuthenticationValidation from HttpClientModule.

google-labs-jules[bot] avatar Nov 22 '25 13:11 google-labs-jules[bot]

Skipped: Cannot respond to another bot.

coderabbitai[bot] avatar Nov 22 '25 13:11 coderabbitai[bot]