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

Mark HTTP support as deprecated to be removed in a future release. #790

Closed
wants to merge 5 commits into from

Conversation

johnewart
Copy link
Contributor

@johnewart johnewart commented Sep 28, 2022

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:

  • Code compiles correctly
  • Created/updated tests
  • [NA] Extended the documentation (Javadoc generation should be automatic)

@johnewart johnewart requested review from a team as code owners September 28, 2022 05:09
Copy link
Contributor

@mukundansundar mukundansundar left a comment

Choose a reason for hiding this comment

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

Small changes.
Can you also create an issue to track the http client deprecation...

This requires a docs change as well

@mukundansundar
Copy link
Contributor

Please also see the checkstyle errors

Copy link
Member

@artursouza artursouza left a comment

Choose a reason for hiding this comment

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

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.

@johnewart
Copy link
Contributor Author

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?

Signed-off-by: John Ewart <john@johnewart.net>
Signed-off-by: John Ewart <john@johnewart.net>
@johnewart
Copy link
Contributor Author

Fixed checkstyle errors, removed one of the depreciation tags as requested and also added signoff -- amended and force pushed to keep things simpler.

@johnewart
Copy link
Contributor Author

Created proposal #794 to track this

@artursouza
Copy link
Member

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

Signed-off-by: John Ewart <john@johnewart.net>
Copy link
Contributor

@mukundansundar mukundansundar left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@tanvigour tanvigour left a comment

Choose a reason for hiding this comment

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

LGTM otherwise

@@ -114,6 +117,7 @@ public class DaprClientHttp extends AbstractDaprClient {
this.client = client;
this.isObjectSerializerDefault = objectSerializer.getClass() == DefaultObjectSerializer.class;
this.isStateSerializerDefault = stateSerializer.getClass() == DefaultObjectSerializer.class;
System.out.println("NOTE: DaprClientHttp is deprecated and will be removed in a future release.");
Copy link
Contributor

@tanvigour tanvigour Oct 26, 2022

Choose a reason for hiding this comment

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

NIT, but it might be more noticeable if we change "NOTE" to "deprecation ALERT" or something to the effect that holds attention as a warning that shouldn't be ignored

@codecov
Copy link

codecov bot commented Nov 28, 2022

Codecov Report

Merging #790 (6a89e3d) into master (7593b0e) will decrease coverage by 0.86%.
The diff coverage is 100.00%.

❗ 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%) ⬇️
.../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%) ⬇️
...src/main/java/io/dapr/springboot/DaprTopicKey.java 0.00% <0.00%> (-46.16%) ⬇️
...va/io/dapr/springboot/DaprSubscriptionBuilder.java 0.00% <0.00%> (-35.14%) ⬇️
... 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.

@mukundansundar
Copy link
Contributor

@artursouza Can this be merged?

@artursouza
Copy link
Member

We need to emit a warning because HTTP client can be used without any code change. Just via an env car, for example.

@artursouza
Copy link
Member

Closing this in favor of #824

@artursouza artursouza closed this Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants