java-sdk
java-sdk copied to clipboard
Mark HTTP support as deprecated to be removed in a future release.
Description
In conversation with @artursouza earlier today regarding issue #763 we came to the conclusion that it might just make sense to simply deprecate the HTTP transport and let people implement their own HTTP client in the cases where they don't want to use gRPC. This would eliminate the split-dependency issue and (I believe) also make the JVM transition easier.
This PR marks the HTTP-related client constructors, constants and references as deprecated (at least I think I got all the places we instantiate HTTP transport related bits)
Issue reference
This is related to (and should be able to close) issue #763 -- also related to proposal #794
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list:
- [x] Code compiles correctly
- [x] Created/updated tests
- [NA] Extended the documentation (Javadoc generation should be automatic)
Please also see the checkstyle errors
In addition, we need to log warning if the HTTP protocol is chosen via the property we provide in the SDK, this way the user will see the warning in their logs. Users will not see a warning in code due to these deprecation annotations because this code is not used directly by the user, we have a builder that handles which instance of the client to build.
I agree but see above, we don't have a logging façade dependency / logging in place in the client; do we want to add a new dependency like slf4j for that?
Fixed checkstyle errors, removed one of the depreciation tags as requested and also added signoff -- amended and force pushed to keep things simpler.
Created proposal #794 to track this
I responded. I see 2 options:
SLF4J or System.out.Println() because this is just for giving warnings for deprecation and not for other use cases (yet).
Codecov Report
Merging #790 (6a89e3d) into master (04e7298) will increase coverage by
0.00%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## master #790 +/- ##
=========================================
Coverage 76.75% 76.75%
Complexity 1146 1146
=========================================
Files 104 104
Lines 3626 3627 +1
Branches 418 418
=========================================
+ Hits 2783 2784 +1
Misses 636 636
Partials 207 207
Impacted Files | Coverage Δ | |
---|---|---|
...ain/java/io/dapr/actors/client/DaprHttpClient.java | 100.00% <ø> (ø) |
|
...in/java/io/dapr/actors/runtime/DaprHttpClient.java | 80.70% <ø> (ø) |
|
.../src/main/java/io/dapr/client/DaprApiProtocol.java | 100.00% <ø> (ø) |
|
...rc/main/java/io/dapr/client/DaprClientBuilder.java | 66.66% <ø> (ø) |
|
sdk/src/main/java/io/dapr/client/DaprHttp.java | 92.24% <ø> (ø) |
|
.../src/main/java/io/dapr/client/DaprHttpBuilder.java | 94.44% <ø> (ø) |
|
...k/src/main/java/io/dapr/client/DaprClientHttp.java | 87.03% <100.00%> (+0.03%) |
:arrow_up: |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
Codecov Report
Merging #790 (6a89e3d) into master (7593b0e) will decrease coverage by
0.86%
. The diff coverage is100.00%
.
:exclamation: Current head 6a89e3d differs from pull request most recent head 9a2d7df. Consider uploading reports for the commit 9a2d7df to get more accurate results
@@ Coverage Diff @@
## master #790 +/- ##
============================================
- Coverage 77.62% 76.75% -0.87%
+ Complexity 1161 1146 -15
============================================
Files 105 104 -1
Lines 3647 3627 -20
Branches 419 418 -1
============================================
- Hits 2831 2784 -47
- Misses 603 636 +33
+ Partials 213 207 -6
Impacted Files | Coverage Δ | |
---|---|---|
...ain/java/io/dapr/actors/client/DaprHttpClient.java | 100.00% <ø> (ø) |
|
...in/java/io/dapr/actors/runtime/DaprHttpClient.java | 80.70% <ø> (ø) |
|
.../src/main/java/io/dapr/client/DaprApiProtocol.java | 100.00% <ø> (ø) |
|
...rc/main/java/io/dapr/client/DaprClientBuilder.java | 66.66% <ø> (ø) |
|
sdk/src/main/java/io/dapr/client/DaprHttp.java | 92.24% <ø> (-0.07%) |
:arrow_down: |
.../src/main/java/io/dapr/client/DaprHttpBuilder.java | 94.44% <ø> (ø) |
|
...k/src/main/java/io/dapr/client/DaprClientHttp.java | 87.03% <100.00%> (ø) |
|
.../src/main/java/io/dapr/springboot/DaprRuntime.java | 0.00% <0.00%> (-65.22%) |
:arrow_down: |
...src/main/java/io/dapr/springboot/DaprTopicKey.java | 0.00% <0.00%> (-46.16%) |
:arrow_down: |
...va/io/dapr/springboot/DaprSubscriptionBuilder.java | 0.00% <0.00%> (-35.14%) |
:arrow_down: |
... and 6 more |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
@artursouza Can this be merged?
We need to emit a warning because HTTP client can be used without any code change. Just via an env car, for example.
Closing this in favor of https://github.com/dapr/java-sdk/pull/824