Coder Social home page Coder Social logo

alingse-forks / dubbo-go Goto Github PK

View Code? Open in Web Editor NEW

This project forked from apache/dubbo-go

0.0 1.0 0.0 93.46 MB

Go Implementation For Apache Dubbo

License: Apache License 2.0

Shell 0.03% Go 99.64% Makefile 0.23% Dockerfile 0.01% Smarty 0.09%

dubbo-go's Introduction

Apache Dubbo for Golang

Build Status codecov go.dev reference Go Report Card license


Apache Dubbo is an easy-to-use Web and RPC framework that provides multiple language implementations(Go, Java, Rust, Node.js, Web) for communication, service discovery, traffic management, observability, security, tools, and best practices for building enterprise-ready microservices.

Dubbo-go is the Go implementation of triple protocol(a fully gRPC compatible and HTTP-friendly protocol) and the various features for building microservice architecture designed by Dubbo.

Visit the official website for more information.

Getting started

You can learn how to develop a dubbo-go RPC application step by step in 5 minutes by following our Quick Start demo.

It's as simple as the code shown below, you define a service with Protobuf, provide your own service implementation, register it to a server, and start the server.

func (srv *GreetTripleServer) Greet(ctx context.Context, req *greet.GreetRequest) (*greet.GreetResponse, error) {
	resp := &greet.GreetResponse{Greeting: req.Name}
	return resp, nil
}

func main() {
	srv, _ := server.NewServer(
		server.WithServerProtocol(
			protocol.WithPort(20000),
			protocol.WithTriple(),
		),
	)

	_ := greet.RegisterGreetServiceHandler(srv, &GreetTripleServer{})

	if err := srv.Serve(); err != nil {
		logger.Error(err)
	}
}

After the server is up and running, call your service via cURL:

curl \
    --header "Content-Type: application/json" \
    --data '{"name": "Dubbo"}' \
    http://localhost:20000/greet.GreetService/Greet

Or, you can start a standard dubbo-go client to call the service:

func main() {
	cli, _ := client.NewClient(
		client.WithClientURL("127.0.0.1:20000"),
	)

	svc, _ := greet.NewGreetService(cli)

	resp, _ := svc.Greet(context.Background(), &greet.GreetRequest{Name: "hello world"})
	
	logger.Infof("Greet response: %s", resp.Greeting)
}

See the samples for detailed information on usage. Next, learn how to deploy, monitor and manage the traffic of your dubbo-go application by visiting the official website.

Features

dubbo-go-architecture

  • RPC Protocols: Triple, gRPC compatible and HTTP-friendly
  • Service Discovery: Nacos, Zookeeper, Etcd, Polaris-mesh, Consul.
  • Load Balance: Adaptive, Random, RoundRobin, LeastActive, ConsistentHash
  • Traffic Management: traffic split, timeout, rate limiting, canary release
  • Configuration: yaml file, dynamic configuration(Nacos, Zookeeper, etc.).
  • Observability: metrics(Prometheus, Grafana) and tracing(Jaeger, Zipkin).
  • HA Strategy: Failover, Failfast, Failsafe/Failback, Available, Broadcast, Forking

Ecosystem

Contributing

Please visit CONTRIBUTING for details on submitting patches and the contribution workflow.

Contact

If you are using apache/dubbo-go and think that it helps you or want to contribute code for Dubbo-go, please add your company to the user list to let us know your needs.

See more user cases

License

Apache Dubbo-go software is licensed under the Apache License Version 2.0. See the LICENSE file for details.

dubbo-go's People

Contributors

alexstocks avatar zouyx avatar hxmhlt avatar fangyincheng avatar laurencelizhixin avatar patrick0308 avatar flycash avatar dependabot[bot] avatar pantianying avatar sxllwx avatar cvictory avatar wenxuwan avatar watermelo avatar zhaoyunxing92 avatar aliiohs avatar beiwei30 avatar justxuewei avatar codingsinger avatar cityiron avatar ygrylls avatar xujianhai666 avatar lzp0412 avatar sdttttt avatar chickenlj avatar zonghaishang avatar finalt avatar ztelur avatar cjphaha avatar wongoo avatar pherzheyu avatar

Watchers

 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.