All Projects → rpcxio → Rpcx Gateway

rpcxio / Rpcx Gateway

Licence: apache-2.0
http gateway for rpcx services. Clients in any programming languages can call them

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Rpcx Gateway

Tenso
Tenso is an HTTP REST API framework
Stars: ✭ 167 (+15.17%)
Mutual labels:  microservices, microservice, gateway
Saluki
Spring Boot starter module for gRPC framework.
Stars: ✭ 267 (+84.14%)
Mutual labels:  microservice, rpc, gateway
Xian
reactive风格的微服务框架
Stars: ✭ 196 (+35.17%)
Mutual labels:  microservices, rpc, gateway
Krakend Ce
KrakenD Community Edition. Make your binary of KrakenD API Gateway
Stars: ✭ 245 (+68.97%)
Mutual labels:  microservices, microservice, service-mesh
Istio
Connect, secure, control, and observe services.
Stars: ✭ 28,970 (+19879.31%)
Mutual labels:  microservices, microservice, service-mesh
Tree Gateway
This is a full featured and free API Gateway
Stars: ✭ 160 (+10.34%)
Mutual labels:  microservices, microservice, gateway
Motan Openresty
A cross-language RPC framework for rapid development of high performance distributed services based on OpenResty.
Stars: ✭ 117 (-19.31%)
Mutual labels:  microservice, rpc, service-mesh
Go Micro Boilerplate
The boilerplate of the GoLang application with a clear microservices architecture.
Stars: ✭ 147 (+1.38%)
Mutual labels:  microservices, microservice, rpc
Rpcx
Best microservices framework in Go, like alibaba Dubbo, but with more features, Scale easily. Try it. Test it. If you feel it's better, use it! 𝐉𝐚𝐯𝐚有𝐝𝐮𝐛𝐛𝐨, 𝐆𝐨𝐥𝐚𝐧𝐠有𝐫𝐩𝐜𝐱!
Stars: ✭ 6,516 (+4393.79%)
Mutual labels:  microservices, microservice, rpc
Apioak
Full Lifecycle Management API Gateway.
Stars: ✭ 335 (+131.03%)
Mutual labels:  microservice, gateway, service-mesh
Armeria
Your go-to microservice framework for any situation, from the creator of Netty et al. You can build any type of microservice leveraging your favorite technologies, including gRPC, Thrift, Kotlin, Retrofit, Reactive Streams, Spring Boot and Dropwizard.
Stars: ✭ 3,392 (+2239.31%)
Mutual labels:  microservices, rpc, gateway
Mini Platform
Mini-Platform致力于更简洁易用的轻量级微服务治理平台。
Stars: ✭ 45 (-68.97%)
Mutual labels:  microservices, microservice, gateway
Remit
RabbitMQ-backed microservices supporting RPC, pubsub, automatic service discovery and scaling with no code changes.
Stars: ✭ 24 (-83.45%)
Mutual labels:  microservices, microservice, rpc
Dubbo Go Pixiu
Based on the proxy gateway service of dubbo-go, it solves the problem that the external protocol calls the internal Dubbo cluster. At present, it supports HTTP and gRPC[developing].
Stars: ✭ 124 (-14.48%)
Mutual labels:  microservices, microservice, gateway
Dapeng Soa
A lightweight, high performance micro-service framework
Stars: ✭ 101 (-30.34%)
Mutual labels:  microservice, rpc
Jupiter
Jupiter是一款性能非常不错的, 轻量级的分布式服务框架
Stars: ✭ 1,372 (+846.21%)
Mutual labels:  microservice, rpc
Whatsmars
Java生态研究(Spring Boot + Redis + Dubbo + RocketMQ + Elasticsearch)🔥🔥🔥🔥🔥
Stars: ✭ 1,389 (+857.93%)
Mutual labels:  microservices, rpc
Netpro
🌈An enhanced version of asp.netcore,Support for netcore3.1
Stars: ✭ 112 (-22.76%)
Mutual labels:  microservice, cross-platform
Hprose Delphi
Hprose is a cross-language RPC. This project is Hprose 2.0 for Delphi and FreePascal
Stars: ✭ 100 (-31.03%)
Mutual labels:  rpc, cross-platform
Dotnet Istanbul Microservices Demo
This is the demo application that i created for my talk 'Microservice Architecture & Implementation with Asp.Net Core' at Dotnet İstanbul Meetup Group.
Stars: ✭ 109 (-24.83%)
Mutual labels:  microservices, microservice

rpcx-gateway

rpcx-gateway is a http gateway for rpcx services.

rpcx is a fast rpc framework. Faster, more features.

You can write rpc http clients in any programming languages such as Java、Python、C#、Node.js、Php、C\C++、Rust and others. See examples

Deployment models

There are two deployment modes: Gateway and Agent

Gateway

You can deploy this as gateway model. Gateway is running at independent servers. Clients sends http requests to gateways, and gateways translate http requests into raw rpcx requests. And then gateways send raw rpcx requests to rpcx services.

when gateways receive rpcx responses, they translates rpcx responses into http responses and return clients.

You can scale gateway easily because it is stateless.

It works like a http load balancer.

Agent

You can also deploy this as agent model. Agents are deploy with clients. They are installed as a daemon application in node of clients. If there are multiple clients in one node, you only need to install one agent.

Clients send http requests to their local agent. The local agent translate http requests into rpcx requests, send rpcx requests to rpcx services, translate rpcx responses into http ressponses.

It works like service mesh.

Protocol

You can send a http request in any programming languages. You must set some extra http headers in requests.

  • X-RPCX-Version: rpcx version
  • X-RPCX-MesssageType: set 0 as request
  • X-RPCX-Heartbeat: is heartbeat request or not, false in default.
  • X-RPCX-Oneway: is one-way request or not, false in default.
  • X-RPCX-SerializeType: 0 as raw bytes, 1 as JSON, 2 as protobuf, 3 as msgpack
  • X-RPCX-MessageID: message ID, uint64 type
  • X-RPCX-ServicePath: service path
  • X-RPCX-ServiceMethod: service method
  • X-RPCX-Meta: extra metadata

For the http response, there are some extra http headers:

  • X-RPCX-Version: rpcx version
  • X-RPCX-MesssageType: 1 as response
  • X-RPCX-Heartbeat: is heartbeat response or not
  • X-RPCX-MessageStatusType: Error or Normal. Error means there is call failure
  • X-RPCX-SerializeType: 0 as raw bytes, 1 as JSON, 2 as protobuf, 3 as msgpack
  • X-RPCX-MessageID: message ID, uint64 type
  • X-RPCX-ServicePath: service path
  • X-RPCX-ServiceMethod: service method
  • X-RPCX-Meta: extra metadata
  • X-RPCX-ErrorMessage: error message if X-RPCX-MessageStatusType is Error

Example

There is a golang http client example:

package main

import (
	"bytes"
	"io/ioutil"
	"log"
	"net/http"

	"github.com/rpcxio/rpcx-gateway"

	"github.com/smallnest/rpcx/codec"
)

type Args struct {
	A int
	B int
}

type Reply struct {
	C int
}

func main() {
	cc := &codec.MsgpackCodec{}

    // request 
	args := &Args{
		A: 10,
		B: 20,
	}
	data, _ := cc.Encode(args)

	req, err := http.NewRequest("POST", "http://127.0.0.1:9981/", bytes.NewReader(data))
	if err != nil {
		log.Fatal("failed to create request: ", err)
		return
    }
    
    // set extra headers
	h := req.Header
	h.Set(gateway.XSerializeType, "3")
	h.Set(gateway.XServicePath, "Arith")
	h.Set(gateway.XServiceMethod, "Mul")

    // send to gateway
	res, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal("failed to call: ", err)
	}
	defer res.Body.Close()

	// handle http response
	replyData, err := ioutil.ReadAll(res.Body)
	if err != nil {
		log.Fatal("failed to read response: ", err)
	}

    // parse reply
	reply := &Reply{}
	err = cc.Decode(replyData, reply)
	if err != nil {
		log.Fatal("failed to decode reply: ", err)
	}

	log.Printf("%d * %d = %d", args.A, args.B, reply.C)
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].