-
Notifications
You must be signed in to change notification settings - Fork 207
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
Provide custom grpc/http client for DaprClientBuilder as in #683 #690
base: master
Are you sure you want to change the base?
Conversation
README.md
Outdated
|
||
```java | ||
DaprClientBuilder daprClientBuilder = new DaprClientBuilder(); | ||
DaprClient client = daprClientBuilder.withOkHttpClient(new OkHttpClient.Builder().readTimeout(5, TimeUnit.SECONDS)).build(); |
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 actually plan to remove the dependency on OkHTTP. Adding that to our public methods will make that harder. Why can't a custom gRPC or HTTP client be implemented with the existing interfaces?
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.
The DaprClientBuilder create the channel internally and not allowing a way to override that outside.
README.md
Outdated
|
||
```java | ||
DaprClientBuilder daprClientBuilder = new DaprClientBuilder(); | ||
ManagedChannelBuilder managedChannelBuilder = Grpc.newChannelBuilder("localhost:8000", TlsChannelCredentials.create()) |
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.
This is interesting. Which are the most common settings for a managed channel? Can this be done via additional java properties?
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.
Channel has everything that matters and as I know we cannot control them via out of the box sys properties. Example using my own managed executor service
@artursouza I updated the PR with new changes and reverted the old commit. New change is minimal as I provided a easy way to extend the builder class. Because maintaining a two Builder classes is hard to maintain as code is duplicated. |
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.
@subash89 Please sign off your commits following : https://github.com/dapr/java-sdk/blob/master/CONTRIBUTING.md#developer-certificate-of-origin-signing-your-work
caffa08
to
b7e364c
Compare
Looks like it didn't like my reverse commit. I followed |
@subash89 Can you rebase all your commits into a single commit ? Also could you fix the check style violations in the PR? |
@mukundansundar This is my first PR, where to find checkstyle report inorder to fix those. |
```java | ||
|
||
DaprExtensibleClientBuilder daprClientBuilder = new DaprExtensibleClientBuilder(); | ||
ManagedChannelBuilder managedChannelBuilder = Grpc.newChannelBuilder("localhost:8000", TlsChannelCredentials.create()) |
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.
Please, use properties like Properties.SIDECAR_IP.get()
to make this portable when users run using a different host or port in standalone mode.
/** | ||
* A builder for the DaprClient. | ||
*/ | ||
public class DaprExtensibleClientBuilder extends DaprClientBuilder{ |
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 would make this a GRPC specific builder and force the GRPC protocol, even if property is for HTTP.
With the current design, it would be possible for the code to set the GRPC managed channel and a Java property force the client built to be the HTTP instance.
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.
Make sense.
@artursouza meantime I update the PR, can you pls suggest a way to build this on a mac or some easy way to find out what are the checkstyle violaitons are. |
@artursouza Updated the PR. please let me know. |
fe6c9d7
to
5d985b4
Compare
* Adding javadocs to some Domain classes Signed-off-by: pravinpushkar <[email protected]> * Fixing code coverage Signed-off-by: pravinpushkar <[email protected]> * Incorporating review comments Signed-off-by: pravinpushkar <[email protected]> Signed-off-by: Subash Gamage <[email protected]>
Signed-off-by: Mukundan Sundararajan <[email protected]> Co-authored-by: Artur Souza <[email protected]> Signed-off-by: Subash Gamage <[email protected]>
…Subash Gamage <[email protected]> Signed-off-by: Subash Gamage <[email protected]>
…off-by: Subash Gamage <[email protected]>" This reverts commit 1d88c76. Signed-off-by: Subash Gamage <[email protected]>
…d-off-by: Subash Gamage <[email protected]> Signed-off-by: Subash Gamage <[email protected]>
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 2.5.0 to 3. - [Release notes](https://github.com/actions/setup-java/releases) - [Commits](actions/setup-java@v2.5.0...v3) --- updated-dependencies: - dependency-name: actions/setup-java dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: Subash Gamage <[email protected]>
Bumps [actions/github-script](https://github.com/actions/github-script) from 5 to 6. - [Release notes](https://github.com/actions/github-script/releases) - [Commits](actions/github-script@v5...v6) --- updated-dependencies: - dependency-name: actions/github-script dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: Subash Gamage <[email protected]>
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v2...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: Subash Gamage <[email protected]>
Signed-off-by: Subash Gamage <[email protected]>
* Add workflow and badge Signed-off-by: Shubham Sharma <[email protected]> * Encode space in URL Signed-off-by: Shubham Sharma <[email protected]> Signed-off-by: Subash Gamage <[email protected]>
* Add workflow and badge Signed-off-by: Shubham Sharma <[email protected]> * Encode space in URL Signed-off-by: Shubham Sharma <[email protected]> * Update FOSSA workflow condition Signed-off-by: Shubham Sharma <[email protected]> Signed-off-by: Subash Gamage <[email protected]>
* remove deprecated classes Signed-off-by: Mukundan Sundararajan <[email protected]> * remove builder class ref in ITs Signed-off-by: Mukundan Sundararajan <[email protected]> * fix setter in IT Signed-off-by: Mukundan Sundararajan <[email protected]> Signed-off-by: Subash Gamage <[email protected]>
Signed-off-by: pravinpushkar <[email protected]> Signed-off-by: Subash Gamage <[email protected]>
@artursouza any help appreciated. |
@subash89 Can you merge with latest master resolve conflicts and see if you are able to build it with the changes in master? |
@mukundansundar main problem I am having is to build this in a mac? |
Does this happen with the latest changes from master too? |
Yes in master too |
Can this be build on a linux box ? |
the build workflow is on a linux runner only |
Please commit the changes for Managed channel to the release branch. With current version it going with default config. |
@subash89 - mind resolving the conflicts? |
gentle ping @subash89 |
Signed-off-by: Subash Gamage [email protected]
Description
This is to Enhance DaprClientBuilder to override gRPC and Http Client. Complete description and reference JIRA can be found at #683
This includes changes in DaprClientBuilder class to accept a managed grpc client as well as ok http client.
Issue reference
#683
Please reference the issue this PR will close: #[issue number]
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: