Giter VIP home page Giter VIP logo

grpc-java-polaris's Introduction

gRPC-Java-Polaris

codecov

English | 简体中文

Introduction

gRPC-Java-Polaris is a service management component based on the Grpc extension, which is convenient for developers who use Grpc to quickly access polaris and use the functions of service registration, load balancing, fusing, and current limiting provided by polaris.

Catalog Introduction

  • grpc-java-polaris        Core code based on Grpc extended functions
  • grpc-java-polaris-example    Get started quickly with the use case of grpc-java-polaris

How To Use

Source installation

Copy the following command to clone the source code to the local:

git clone https://github.com/polarismesh/grpc-java-polaris.git

Then execute the install command to install the grpc-java-polaris project to the local maven warehouse:

mvn clean install -U -Dmaven.test.skip=true

Use

Add grpc-java-polaris dependency to the developed Grpc project:

<dependency>
   <groupId>com.tencent.polaris</groupId>
   <artifactId>grpc-java-polaris</artifactId>
   <version>${grpc-java-polaris.version}</version>
</dependency>

The server uses the PolarisGrpcServer provided by the grpc-java-polaris package to create a grpc server. PolarisGrpcServer internally encapsulates service registration, heartbeat logic, etc:

PolarisGrpcServer polarisGrpcServer = PolarisGrpcServer.builder()
        .port(50051)
        .namespace("default")
        .applicationName("grpc-demo-java")
        .metadata(null)
        .bindableServices(services)
        .build();
        
polarisGrpcServer.start();

The client need replace the ManagedChannelBuilder to PolarisManagedChannelBuilder:

ManagedChannel channel = PolarisManagedChannelBuilder.forTarget("polaris://grpc-demo-java:8080?namespace=default")
        .usePlaintext().build();

Examples

grpc-java-polaris's People

Contributors

li-xiao-shuang avatar andrewshan avatar chuntaojun avatar stan9333 avatar lepdou avatar ranchowang avatar wang007 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.