All Projects → stingbo → gome

stingbo / gome

Licence: MIT license
gome- Golang Match Engine, uses Golang for calculations, gRPC for services, ProtoBuf for data exchange, RabbitMQ for queues, and Redis for cache implementation of high-performance matching engine microservices/ gome-高性能撮合引擎微服务

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to gome

Plumber
A swiss army knife CLI tool for interacting with Kafka, RabbitMQ and other messaging systems.
Stars: ✭ 514 (+993.62%)
Mutual labels:  protobuf, rabbitmq
rails-microservices-book
A guide to building distributed Ruby on Rails applications using Protocol Buffers, NATS and RabbitMQ
Stars: ✭ 23 (-51.06%)
Mutual labels:  protobuf, rabbitmq
Rabbit-OJ-Backend
Using Go & MySQL & Docker & Web Socket & gRPC & Kafka & Zookeeper & Protobuf. Distributed and Scalable Open Judge System for Algorithms.
Stars: ✭ 20 (-57.45%)
Mutual labels:  protobuf, rabbitmq
Myth
Reliable messages resolve distributed transactions
Stars: ✭ 1,470 (+3027.66%)
Mutual labels:  protobuf, rabbitmq
your-connection-deserves-a-name
Examples and code to assign a name to your MongoDB, MySQL, NATS, Oracle, PostgreSQL, RabbitMQ, and redis connection.
Stars: ✭ 26 (-44.68%)
Mutual labels:  rabbitmq
micro-service-practice
OpenStack+Docker+RestAPI+OAuth/HMAC+RabbitMQ/ZMQ+OpenResty/HAProxy/Nginx/APIGateway+Bootstrap/AngularJS+Ansible+K8S/Mesos/Marathon构建/探索微服务最佳实践。
Stars: ✭ 25 (-46.81%)
Mutual labels:  rabbitmq
yages
Yet another gRPC echo server (YAGES)
Stars: ✭ 28 (-40.43%)
Mutual labels:  protobuf
Bynar
Server remediation as a service
Stars: ✭ 53 (+12.77%)
Mutual labels:  protobuf
rejected
rejected is a consumer framework for RabbitMQ
Stars: ✭ 56 (+19.15%)
Mutual labels:  rabbitmq
python-asynchronous-tasks
😎Asynchronous tasks in Python with Celery + RabbitMQ + Redis
Stars: ✭ 37 (-21.28%)
Mutual labels:  rabbitmq
sample-spring-cloud-stream
sample microservices communicating asynchronously using spring cloud stream, rabbitmq
Stars: ✭ 22 (-53.19%)
Mutual labels:  rabbitmq
grabbit
A lightweight transactional message bus on top of RabbitMQ
Stars: ✭ 87 (+85.11%)
Mutual labels:  rabbitmq
sample-message-driven-microservices
sample spring cloud application that integrates with rabbitmq through spring cloud stream framework as shows how to setup message-driven microservices basing on publish-subscribe model, consumer groups
Stars: ✭ 28 (-40.43%)
Mutual labels:  rabbitmq
celery-kubernetes-example
Small Flask app with scalable, asynchronous backend workers deployed on Kubernetes.
Stars: ✭ 79 (+68.09%)
Mutual labels:  rabbitmq
django-grpc
Easy gRPC service based on Django application
Stars: ✭ 177 (+276.6%)
Mutual labels:  protobuf
api
Speechly public API definitions and generated code
Stars: ✭ 15 (-68.09%)
Mutual labels:  protobuf
AMQPClient.jl
A Julia AMQP (Advanced Message Queuing Protocol) / RabbitMQ Client.
Stars: ✭ 30 (-36.17%)
Mutual labels:  rabbitmq
read-protobuf
Small library to read serialized protobuf(s) directly into Pandas Dataframe
Stars: ✭ 28 (-40.43%)
Mutual labels:  protobuf
protobuf-example-java
Companion Repository for my Protocol Buffers course
Stars: ✭ 67 (+42.55%)
Mutual labels:  protobuf
protobuf-ipc-example
Protocol buffer IPC example
Stars: ✭ 19 (-59.57%)
Mutual labels:  protobuf

Gome-High performance matchmaking engine microservice

  • Using golang as computing, grpc as service, protobuf as data exchange, rabbitmq as queue, redis as cache to realize high-performance matchmaking engine micro service

  • 中文文档

Requirement

Usage

  1. Use docker to deploy the operating environment with one click,Enter the gome container,docker exec -it gome bash

  2. Enter the api interface definition directory and generate a gRPC interface definition file: cd /go/src/gome/api && protoc --go_out=plugins=grpc:. *.proto

  3. Enter the project directory, copy and modify the configuration: cd /go/src/gome && copy config.example.yaml config.yaml

  4. Start the gRPC server:go run main.go

  5. Start script to match consumption RabbitMQ queue:go run match.go symbol,symbol is the name of the trading pair,such as btc2usdt,the symbol should be the same as when called by the client

  6. Start script consumption match result RabbitMQ queue:go run match_notice.go symbol.

Description

  • gome Catalog description:

    api, RPC interface definition directory, using ProtoBuf 3 version

    engine, matching engine to realize logical catalog

    grpc, gRPC service script

    redis, redis client

    utils, tool script directory

    main.go, entry file

    match.go, matchmaking script

    match_notice.go, match result consumption script

    test.go, test script, the command is as follows:

      1. Place an order:`go run test.go doOrder`
      2. Cancel order:`go run test.go delOrder`
      3. Get symbol depth:`go run test.go getDepth symbol transaction`
      4. View command help:`go run test.go help`
    
  • Gome will use the symbol name as the order queue, the matching engine will consume this queue, and the matching result will be pushed to notice:+symbol as the name queue, such as notice:btc2usdt

  • At present, only the data is printed when consuming the transaction result queue, and there is no other function. Users can consume this queue by themselves to implement subsequent logic, such as updating the database, notifying users, etc. Gome will add the address push function according to the configuration in the future, so use Users only need to configure the receiving address to receive the results and then process

  • This project is based on my previous PHP project, replacing the queue with RabbitMQ, Redis only as a cache, and then using Golang and gRPC to achieve microservices

  • The specific implementation ideas and data structure design of gome can be viewed Laravel-based matching service project

  • This project does not need to rely on other environments. After running the environment with docker, other projects can be connected and called, such as:

    • PHP client, composer installation, ready to use out of the box
  • In the OrderRequest of the api, uuid (user ID) and oid (order ID) should be unique to the system. In other words, the two should not be duplicated in the system. I defined the string type to facilitate the primary key to be non-incremental. Database usage

Summary

  1. If you are using a docker environment, you need to enter the gome container to perform the corresponding operation, or use Supervisor to automatically start the relevant script when the container is started

  2. Enter the rabbitmq container, docker exec -it rabbitmq bash, view the existing queue: rabbitmqctl list_queues, delete the queue: rabbitmqctl delete_queue queuename

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].