-
Notifications
You must be signed in to change notification settings - Fork 224
Setting default props for DaprClient #1567
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: salaboy <Salaboy@gmail.com>
966eb4f
to
0ba7448
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@dapr/maintainers-java-sdk @dapr/approvers-java-sdk without setting these defaults, Spring Boot doesn't know where to find Dapr when running the application. This force the user to set the properties when they shouldn't. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1567 +/- ##
============================================
+ Coverage 76.91% 78.44% +1.52%
- Complexity 1592 1908 +316
============================================
Files 145 215 +70
Lines 4843 5831 +988
Branches 562 649 +87
============================================
+ Hits 3725 4574 +849
- Misses 821 916 +95
- Partials 297 341 +44 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@salaboy I like the idea, however I think the endpoint syntax should be a little bit different. It should include the port as well.
I have looked in these places:
- GRPC endpoint -
if ((grpcEndpoint != null) && !grpcEndpoint.isEmpty()) { - HTTP endpoint -
return new DaprHttp(endpoint, apiToken, readTimeout, HTTP_CLIENT);
In both of these places the expectation is that we provide the port as part of endpoint.
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
|
||
@ConfigurationProperties(prefix = "dapr.client") | ||
public class DaprClientProperties { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wondering if an endpoints shouldn't have the port. As far as I remember there is some parsing logic in the network utils.
|
||
}); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could remove unnecessary new lines.
Description
Setting the default values for DaprClient Spring Boot properties.
Issue reference
We strive to have all PR being opened based on an issue, where the problem or feature has been discussed prior to implementation.
Please reference the issue this PR will close: #1566
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: