1 Star 0 Fork 911

inyu/zbus

forked from 开放金融技术/zbus 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT
            /\\\       
            \/\\\        
             \/\\\    
 /\\\\\\\\\\\ \/\\\         /\\\    /\\\  /\\\\\\\\\\     
 \///////\\\/  \/\\\\\\\\\  \/\\\   \/\\\ \/\\\//////     
       /\\\/    \/\\\////\\\ \/\\\   \/\\\ \/\\\\\\\\\\    
      /\\\/      \/\\\  \/\\\ \/\\\   \/\\\ \////////\\\  
     /\\\\\\\\\\\ \/\\\\\\\\\  \//\\\\\\\\\   /\\\\\\\\\\  
     \///////////  \/////////    \/////////   \//////////       QQ Group: 467741880

ZBUS = MQ + RPC

zbus strives to make Message Queue and Remote Procedure Call fast, light-weighted and easy to build your own service-oriented architecture for many different platforms. Simply put, zbus = mq + rpc.

zbus carefully designed on its protocol and components to embrace KISS(Keep It Simple and Stupid) principle, but in all it delivers power and elasticity.

Features

  • Fast MQ on disk, capable of unicast, multicast and broadcast messaging models
  • Easy RPC support out of box, language agnostic
  • Officially support Java/.NET/Javascript/C_C++/Python/Go/PHP clients
  • Extremely light-weighted
  • High Availability inside, able to join or leave any distributed components
  • TCP/HTTP/WebSocket, Monitor, all in one port, support DMZ deployment
  • Based on simple protocol: HTTP-header extension, and browser access friendly

Clients

zbus-java

zbus-dotnet

zbus-javascript

zbus-python

zbus-php

zbus-cpp

zbus-go

Getting started

In zbus-dist directory, just run zbus.bat/sh, JDK6+ required.

Incase you may interest in the client projects, go to zbus source root directory

git submodule update --init --recursive  

Maven

<dependency>
	<groupId>io.zbus</groupId>
	<artifactId>zbus</artifactId>
	<version>0.9.0-SNAPSHOT</version>
</dependency>

Performance

Fast performance test (Apache Benchmark)

Declare MQ: http://localhost:15555/declare/MyTopic

Produce 
ab -k -c 32 -n 1000000 http://localhost:15555/produce/MyTopic
Consume 
ab -k -c 32 -n 1000000 http://localhost:15555/consume/MyTopic

Single Mac i7 box with SSD 
Produce:  ~80,000/s
Consume:  ~90,000/s
RPC InProc: ~60,000/s

MQ and RPC at a glance

In the monitor page http://localhost:15555 , as you can see, there are two sections Monitor

  1. Tracked Servers

    List all the MqServer joined.

    zbus instance by default plays the role of both Tracker and MqServer, and if tracker mode enabled, the zbus instance is able to accept other zbus instances to join as tracked server. And the tracked items such topics are aggregated for viewing.

    To join zbus tracker(s), just start zbus with --tracker={address_list}

  2. TopicTable

    List all Topic avaiable for the tracked MqServers

    Including important fields as Topic name, message depth in disk, consume-groups, consumer online, message consume filter.

    For more detailed explanation of these glossaries please refer to components section.

In zbus, RPC is implemented via MQ, a MQ can be a message container for the RPC service, and internally it contains a mask to indicate the MQ's purpose of RPC.

The monitor page keeps evolving, more and more items will be added in.

Components

Archit

The above figure shows the 3 major distributed components--broker, producer and consumer

Broker

Single mode, Broker is the zbus instance(MqServer), stores messages produced, delivers messages to consumers.

HA mode, Broker is an abstracted server(Trackers + MqServers), capable of failover and smart algorithms on selection of MqServer, but still just work like a single MqServer.

Producer

Producer publish message to Broker, capable of customerize the selection algorithm based on the application's will.

Consumer

Consumer takes message from Broker, capable of relocating consuming position based on message offset.

Topic

Topic is a message queue identity, message with same topic fall into the same message store queue.

ConsumeGroup

ConsumeGroup controls the consumer behavior, it stores latest consumed position of the topic, and filter out message if ConsumeGroup's filter is set. ConsumeGroup is super light-weighted in zbus, it is just like a pointer to the message queue, with carefully craft on ConsumeGroup, applications can form unicast, multicast, and broadcast messaging models.

Protocol

Internal Design

Broker Design

DiskQueue Design

RPC Design

The MIT License (MIT) Copyright (c) 2016 rushmore Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

ZBUS = MQ + RPC, a lightweight yet powerful MQ and RPC to build elastic micro-service bus 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/inyu_admin/zbus.git
git@gitee.com:inyu_admin/zbus.git
inyu_admin
zbus
zbus
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891