Giter Site home page Giter Site logo

opensergo-java-sdk's Introduction

OpenSergo Logo

OpenSergo Java SDK

OpenSergo Java SDK CI Maven Central License

Introduction

Documentation

See the OpenSergo Website for the official website of OpenSergo.

See the 中文文档 for document in Chinese.

Quick Start

  1. Add dependency in Maven pom.xml:
<!-- replace here with the latest version -->
<dependency>
    <groupId>io.opensergo</groupId>
    <artifactId>opensergo-java-sdk</artifactId>
    <version>0.1.0</version>
</dependency>
  1. Subscribe data from OpenSergo control plane:
// 1. Create client with remote host and port of OpenSergo control plane
OpenSergoClient client = OpenSergoClientManager.get().getOrCreateClient(host, port);
// 2. Start the OpenSergo client.
client.start();

// 3. Subscribe the config of the target (namespace, appName, kind)
client.subscribeConfig(new SubscribeKey("default", "my-service", configKind),
    new OpenSergoConfigSubscriber() {
        @Override
        public boolean onConfigUpdate(SubscribeKey subscribeKey, Object dataList) {
            // Handle received config here
            System.out.println("key: " + subscribeKey + ", data: " + dataList);
            return true;
        }
    });

opensergo-java-sdk's People

Contributors

123liuziming avatar jax4li avatar jnan806 avatar panxiaojun233 avatar robberphex avatar sczyh30 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.