Skip to content

refactor: move service invocation out of DaprClientImpl - #1918

Open
javier-aliaga wants to merge 2 commits into
dapr:masterfrom
javier-aliaga:refactor/client-service-invocation
Open

javier-aliaga wants to merge 2 commits into
dapr:masterfrom
javier-aliaga:refactor/client-service-invocation

Conversation

@javier-aliaga

Copy link
Copy Markdown
Contributor

Description

Ninth step of splitting DaprClientImpl into package-private classes, one per building block. This PR moves service invocation.

  • New package-private class DaprServiceInvocationClient holds invokeMethod, invokeHttpClient and the HTTP response mapping (getMonoForHttpResponse). The bodies are unchanged.
  • The public methods on DaprClientImpl keep their signatures and annotations, and delegate in one line.
  • No public API change. DaprClientImpl goes from 983 to 911 lines.

Issue reference

Part of #1875

Checklist

  • Code compiles correctly
  • Created/updated tests. DaprClientHttpTest covers service invocation through the public methods. The 670 sdk unit tests pass unchanged.
  • Extended the documentation. Not needed, internal change.

Signed-off-by: Javier Aliaga <javier@diagrid.io>
Copilot AI lite review requested due to automatic review settings November 22, 2026 11:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The refactoring cleanly extracts service-invocation logic while preserving the public API and has no active review issues.

No open issues 🎉

What changed in this PR

This PR continues the internal decomposition of DaprClientImpl by moving service invocation logic into a package-private DaprServiceInvocationClient while preserving the existing public API and behavior.

Changes:

  • Extracted HTTP method invocation, HTTP client creation, request serialization, and response deserialization.
  • Added delegation from DaprClientImpl to the new service invocation client.
  • Removed service-invocation-specific implementation details and imports from DaprClientImpl.
File Description
sdk/​src/​main/​java/​io/​dapr/​client/​DaprServiceInvocationClient.java Adds the package-private service invocation client containing the extracted invocation and HTTP response mapping logic.
sdk/​src/​main/​java/​io/​dapr/​client/​DaprClientImpl.java Initializes the extracted service invocation client and delegates the existing public service invocation methods.

Review effort: Lite

Signed-off-by: Javier Aliaga <javier@diagrid.io>
Copilot AI lite review requested due to automatic review settings November 22, 2026 11:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the refactor, which preserves the public API while adding targeted coverage for key service-invocation edge cases.

No open issues 🎉

Review effort: Lite

@javier-aliaga
javier-aliaga marked this pull request as ready for review November 22, 2026 11:35
@javier-aliaga
javier-aliaga requested review from a team as code owners November 22, 2026 11:35
@cicoyle cicoyle self-assigned this Nov 23, 2026
@codecov

codecov Bot commented Nov 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.72%. Comparing base (f19b986) to head (a0c36aa).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1918      +/-   ##
============================================
+ Coverage     82.70%   82.72%   +0.01%     
- Complexity     3967     3973       +6     
============================================
  Files           359      360       +1     
  Lines         11965    11972       +7     
  Branches       1339     1339              
============================================
+ Hits           9896     9904       +8     
- Misses         1561     1563       +2     
+ Partials        508      505       -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants