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

Add initial implementation of OpenSergo Java client #1

Merged
merged 11 commits into from
Sep 25, 2022

Conversation

sczyh30
Copy link
Member

@sczyh30 sczyh30 commented Aug 16, 2022

Add initial implementation of OpenSergo Java client.

  • Add fundamental client subscribe and config cache mechanism
  • Add fundamental implementation of OpenSergo gRPC client

@sczyh30
Copy link
Member Author

sczyh30 commented Aug 23, 2022

An example of how data-plane integrates with OpenSergo Java SDK:

OpenSergoClient client = new OpenSergoClient(host, port);
client.start();

// Push-model
client.subscribeConfig(new SubscribeKey(namespace, appName, configKind),
    new OpenSergoConfigSubscriber() {
        @Override
        public boolean onConfigUpdate(SubscribeKey subscribeKey, Object dataList) {
            // Handle received config here
            System.out.println("key: " + subscribeKey + ", data: " + dataList);
            return true;
        }
    });

@sczyh30 sczyh30 added the kind/feature Category issues or PRs related to feature request label Aug 23, 2022
src/main/proto/fault_tolerance/v1/fault_tolerance.proto Outdated Show resolved Hide resolved
src/main/proto/fault_tolerance/v1/fault_tolerance.proto Outdated Show resolved Hide resolved
Node node = 2;

repeated ServiceMetadata service_metadata = 3;
reserved 4 to 16;
Copy link
Collaborator

Choose a reason for hiding this comment

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

reserved tag conflict with docs https://github.com/opensergo/opensergo-specification/blob/main/specification/zh-Hans/README.md
maybe the docs is needed to change the tag range

image

src/main/proto/fault_tolerance/v1/fault_tolerance.proto Outdated Show resolved Hide resolved
@jnan806
Copy link
Collaborator

jnan806 commented Sep 8, 2022

是否应该将 *.proto 文件抽取到 opensergo/opensergo-proto 项目

@sczyh30
Copy link
Member Author

sczyh30 commented Sep 8, 2022

是否应该将 *.proto 文件抽取到 opensergo/opensergo-proto 项目

对应的 proto 会提交到 opensergo-proto 项目里面;不过如何在 SDK 项目中比较方便地引用 proto,社区可以给一些更好的建议

@jnan806
Copy link
Collaborator

jnan806 commented Sep 8, 2022

对应的 proto 会提交到 opensergo-proto 项目里面;不过如何在 SDK 项目中比较方便地引用 proto,社区可以给一些更好的建议

refer to opensergo/opensergo-proto#3

@jnan806
Copy link
Collaborator

jnan806 commented Sep 13, 2022

@sczyh30

PTAL!THX.

针对 issue opensergo/opensergo-proto#3

已经将 grpc协议javago两中SDK的依赖实现提交在 PR 中,麻烦review并讨论下是否合理。

opensergo/opensergo-proto#4

@sczyh30
Copy link
Member Author

sczyh30 commented Sep 25, 2022

Hi, I've updated the latest proto and polished SDK code (a lot of bugs has been fixed...).

cc @opensergo/opensergo-maintainer

@sczyh30 sczyh30 marked this pull request as ready for review September 25, 2022 15:31
@sczyh30 sczyh30 merged commit 4270c11 into opensergo:main Sep 25, 2022
@jnan806
Copy link
Collaborator

jnan806 commented Sep 26, 2022

ok, I've synchronized my fork branch https://github.com/jnan806/opensergo-java-sdk-review-sczyh30/tree/stubcode-based-sczyh30
Please take a review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Category issues or PRs related to feature request
Projects
None yet
2 participants