32 Star 159 Fork 59

Bwar / Nebula

Create your Gitee Account
Explore and code with more than 8 million developers,Free private repositories !:)
Sign up
Clone or Download
Sync branch
Notice: Creating folder will generate an empty file .keep, because not support in Git

English | 中文                 Bwar's blog.

    _   __     __          __
   / | / /__  / /_  __  __/ /___ _
  /  |/ / _ \/ __ \/ / / / / __ `/
 / /|  /  __/ /_/ / /_/ / / /_/ /
/_/ |_/\___/_.___/\__,_/_/\__,_/
                                one-click installation 

Nebula : a powerful framework for building highly concurrent, distributed, and resilient message-driven applications for C++.

Author Platform License

  1. Overview
  2. Features
  3. Getting Start
  4. Documentation
  5. Depend on
  6. Main Projects
  7. Todo list
  8. Change log


Nebula is a flexible, high-performance business-oriented IoC distributed network framework developed in C++ language, designed for production environments. It supports multiple application layer communication protocols including proto3, http, https, http2, grpc, cassandra, and websocket. Nebula makes it easy to deploy a fast and high-performance distributed service with C++, while keeping the same server architecture and APIs. NebulaBootstrap provides out-of-the-box integration with Nebula service, but can be easily extended to serve other types of application.

Nebula is a production level framework and distributed solution project for instant messaging, data collection, real-time computing, message push and other applications, as well as web api services. There were production applications for instant messaging, data acquisition and real-time analysis on line now, and a recommendation engine application for a large user base will be born soon. By the way, using Nebula for toy-level projects is also good for learning network communication. Bwar welcomes more developers to join the Nebula project.

Nebula can be used as a single high-performance TCP server, but building a cluster based on Nebula will be truly reflect its value. In order to build distributed service clusters quickly, Nebula Bootstrap cluster solutions including various types of services have been developed.


  • Protocol communication such as http, protobuf, websocket, etc.
  • Ssl connection encryption
  • Microservices framework
  • IoC container
  • Dynamic service update
  • Service registration and discovery
  • Service monitoring
  • Configuration management
  • Routing
  • Load balancing
  • Circuit Breakers
  • Leadership election and cluster state
  • A convenient way to extend third-party protocols

Getting Start

Nebula was developed with C++11/C++14 standard, requires a compiler capable of the C++11-standard and at least gcc4.8 (some C++14 features are replaced by C++11 standard when encountering a lower version of the compiler). NebulaBootstrap provides a quick way to build and deploy Nebula. A distributed solution based on NebulaBootstrap will make it easy to develop micro-service applications in C++. All dependencies will be automatically resolved in the following build steps.

first install gcc and auto tools. centos:

   sudo yum install -y gcc gcc-c++
   sudo yum install -y autoconf automake libtool

build step:

  1. wget https://github.com/Bwar/NebulaBootstrap/archive/master.zip

  2. unzip master.zip; rm master.zip; mv NebulaBootstrap-master NebulaBootstrap; chmod u+x deploy.sh; chmod u+x deploy.sh

  3. ./deploy.sh

    Run deploy.sh, the NebulaBootstrap distributed services were build completed. The reliance of Nebula was also automatically downloaded and compiled by deploy from the Internet before the construction of Nebula. The deploy path as follows:

  • NebulaBootstrap

    • bin         server bin location。
    • build        build path,created by deploy.sh, if you do not need to build again, just delete it.(optional)。
    • conf        configuration path.
    • data        application data path. e.g. Nebio which is a data collect and real-time analysis application, write it's data to this path (optional).
    • lib         library path.
    • log         program logs path.
    • plugins       plugins path.
      • logic       plugins for logic server(optional).
    • script       script path. deploy.sh, startup.sh and shutdown.sh were depend on this path.
    • temp        temp file path (optional).
    • configure.sh     run configure.sh for a simple configuration when deploy for the first time.
    • deploy.sh      auto build and deploy.
    • shutdown.sh      shutdown one or more server.
    • startup.sh      startup one or more server.
    • README_cn.md
    • README.md

    build completed, you can start the server:


The server should have started successfully now, startup.sh will print the server that had been started, If not, check logs for reason. Notice that the default configuration file of Nebula limits the number of connections per IP in a period. If you have a large amount of testing, you should check the configuration limit. If the server has been successfully started, testing with postman or curl.

# testing start with NebulaInterface only.
curl -H "Content-Type:application/json" -X POST -d '{"name": "Nebula", "address":"https://github.com/Bwar/Nebula"}' http://${your_ip}:16003/hello

# testing start with NebulaInterface,NebulaLogic and NebulaBeacon.
curl -H "Content-Type:application/json" -X POST -d '{"name": "Nebula", "address":"https://github.com/Bwar/Nebula"}' http://${your_ip}:16003/hello_nebula

A simple testing can be start with a NebulaInterface only, and also can be start with NebulaBootstrap. NebulaBootstrap provided the a cluster HelloWorld, the testing will launch NebulaBeacon, NebulaInterface and NebulaLogic. This is a diagram of the cluster architecture:



The complete documentation for Nebula is available: Nebula class reference

Depend on

Main Projects

Todo list

  • Complete writing user guide

Change log


  • add spec channel
  • use SpecChannel instead of unix socket to transfer file descriptors
  • add SocketChannel migration between threads
  • remove process mode


  • error callback caused by fuse node detection bug fixed
  • redis cluster returns when executing batch write commands and asking bug fixed
  • the channel creation method and use CodecFactory instead
  • Add connection backlog configuration
  • Optimize worker mini load forwarding
  • add dns cache
  • add upstream and downstren monitor
  • add console log


  • codec bind channel circular reference bug fixed
  • CodecProto no packet communication bug fixed
  • enable connection protection configuration


  • async logger optimization
  • add selfchannel sequence
  • StepRedisCluster circuit break and recovery
  • Nodes recovery bug fixed


  • IO optimization, codec plug-in.
  • remove shared_from_this of Channel and Actor and use ChannelWatcher and ActorWatcher instead to improve performance.
  • removed the unload feature of dynamically loaded plugins (which reduces performance).
  • raw data codec is independent into codec.
  • add cassandra client codec.
  • add support for password verification of redis cluster.
  • improve log performance; add asynchronous file logs.


  • circuit breaker optimization
  • http chunk decode bug fixed; resp bulk string bug fixed


  • http2 chunk notice for stream
  • CodecResp bug string decode bug fixed


  • add SelfChannel within the Worker, improve the actor model
  • add service status monitoring and metrics for prometheus
  • add Manager to Manager communication feature
  • add initial connection timeout configuration
  • replace va_list with variadic templates in logger
  • add multi-protocol port support
  • thread id optimization
  • chain optimization
  • http2 dynamic table and stream priority bug fix


  • add native http2 server and client
  • add native grpc server and client
  • channel read and write optimization
  • add absolute log path


  • replace hiredis client with native CodecResp
  • add redis cluster client
  • add raw data transmission
  • add log real-time flush configurability
  • add support for IP address combination node type
  • dispatcher optimization
  • bug fixed


  • add non-pipeline mode support for redis connection
  • the worker thread to start before the Loader thread in thread mode, and bring the worker thread ID to the Loader
  • merge CodecResp and CodecHttp2 written by @nebim
  • add third-party cityhash
  • update CJsonObject
  • bug fixed


  • delay start when loading a large amount of data


  • add worker thread mode


  • separate the network dispatch and actor management from Labor (Manager and Worker) to Dispatcher and ActorBuilder
  • add supports of Actor classes to Manager process, and move the manager system management features to Cmd and Step
  • add Loader
  • optimize Actor dynamic creator
  • optimize HTTP connection and HTTP data sending and receiving
  • RedisChannel bug fixed
  • add bind ip
  • add load stress
  • add codec auto switch


  • the plugin version control dynamically unloads and loads the instant validation feature.
  • optimize reflection dynamic creation of Actor.


  • add Model
  • add Chain
  • simplify Context
  • optimize Actor


  • compatible with gcc4.8 compiler.
  • add cpu affinity inorder to support cpu binding.
  • add dynamic library unload.


  • add configuration management (check Nebcli for detail).


  • NebulaBeacon adds node status information query, registration center leader-fllower election.
  • NebulaInterface adds hello demo.


  • add node info to worker the worker process terminated unexpectedly and restarted by the Manager.
  • ipv6 support.


  • distributed log service test passing.
  • add https support.
  • add keep alive settings to http channel.
  • replace repeated http headers with proto3 map.
  • provides a symmetric encryption key setup interface for channel.
  • bug fix.


  • rewrite with C++14
  • create actors by reflection (using template)
  • add distributed trace log


  • the first runable version


Nebula是一个强大的分布式网络框架,用于以C++快速构建高并发、分布式和弹性的消息驱动应用程序。 expand collapse
C++ and 3 more languages


No release





Load More
can not load any more