All Projects → zhu327 → tormq

zhu327 / tormq

Licence: MIT License
Push messages via websocket, based on Tornado and ZeroMQ

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to tormq

factory
Docker microservice & Crawler by scrapy
Stars: ✭ 56 (+51.35%)
Mutual labels:  tornado
fastweb
fastweb is a web-server integration solution. It based on tornado, celery, thrift.
Stars: ✭ 17 (-54.05%)
Mutual labels:  tornado
greentor
Patch pymysql to support tornado asynchronous
Stars: ✭ 31 (-16.22%)
Mutual labels:  tornado
Westworld-Style-Behavior-Pad-Interface
UPDATE 20210705: Adding ZeroMQ functions in to allow full-duplex comms with deep parts of the hosts' cognitive processes, and expose speech recognition background processes, visual processes, etc. ORIGINAL DESCRIPTION >>>This is a working version of the iconic Behavior Pad "Rose Graph" Interface that the Westworld Techs use to set Host Behaviora…
Stars: ✭ 25 (-32.43%)
Mutual labels:  zeromq
re-gent
A Distributed Clojure agent for running remote functions
Stars: ✭ 18 (-51.35%)
Mutual labels:  zeromq
webTimer
一款时间管理小工具的chrome插件
Stars: ✭ 18 (-51.35%)
Mutual labels:  tornado
fast-poster
🔥🔥🔥 fastposter海报生成器,电商海报编辑器,电商海报设计器,fast快速生成海报 自定义海报制作 海报开发。二维码海报,图片海报,分享海报,二维码推广海报,支持Java Python PHP Go JS 小程序。基于Vue 和Pillow 演示地址:https://poster.prodapi.cn/
Stars: ✭ 329 (+789.19%)
Mutual labels:  tornado
tornado-swagger
No description or website provided.
Stars: ✭ 36 (-2.7%)
Mutual labels:  tornado
zerorpc-dotnet
A .NET implementation of ZeroRPC
Stars: ✭ 21 (-43.24%)
Mutual labels:  zeromq
chat
Chat
Stars: ✭ 12 (-67.57%)
Mutual labels:  tornado
MAVCesium
An experimental web based map display for MAVProxy based on Cesium
Stars: ✭ 28 (-24.32%)
Mutual labels:  tornado
Fukei
A socks proxy based Tornado
Stars: ✭ 82 (+121.62%)
Mutual labels:  tornado
ZMQ.jl
Julia interface to ZMQ
Stars: ✭ 114 (+208.11%)
Mutual labels:  zeromq
OpenScraper
An open source webapp for scraping: towards a public service for webscraping
Stars: ✭ 80 (+116.22%)
Mutual labels:  tornado
zmosq
MQTT/Mosquitto / ZeroMQ proxy
Stars: ✭ 22 (-40.54%)
Mutual labels:  zeromq
github-trending
GitHub trending API powered by Python Tornado.
Stars: ✭ 36 (-2.7%)
Mutual labels:  tornado
memoize
Caching library for asynchronous Python applications.
Stars: ✭ 53 (+43.24%)
Mutual labels:  tornado
PyInstallerGUI
The easiest use Pyinstaller GUI application
Stars: ✭ 15 (-59.46%)
Mutual labels:  tornado
OpenLogReplicator
Open Source Oracle database CDC written purely in C++. Reads transactions directly from database redo log files and streams in JSON or Protobuf format to: Kafka, RocketMQ, flat file, network stream (plain TCP/IP or ZeroMQ)
Stars: ✭ 112 (+202.7%)
Mutual labels:  zeromq
MQL5-JSON-API
Metaquotes MQL5 - JSON - API
Stars: ✭ 183 (+394.59%)
Mutual labels:  zeromq

TORMQ


*************           *************            *************
*  client   *           *   client  *            *   client  *
*************           *************            *************
      |                        |                        |
      |                        |                        |
 *************          **************          **************
 * websocket *          *  websocket *          *  websocket *
 *    HUB    *          *     HUB    *          *      HUB   *
 *************          **************          **************
       \ sub                |  sub              sub/
        \                   |                     /
          ------------------|--------------------
                            | pub
                     ****************
                     *              *
                     *     MPC      *
                     *              *
                     ****************
                            | sub
          ------------------|-------------------
        /                   |                    \
      /                     |                      \
 ***********            **********               ************
 * sdk     *            * sdk    *               * sdk      *
 * service *            * http   *               * other... *
 ***********            **********               ************

Tormq 是基于Tornado ZeroMQ的开发的消息推送框架,具有高性能,高并发,高可用性,可伸缩扩容等特点.

Tormq 按模块可划分为3部分:

  • MPC 消息发布中心,集中处理消息,是SDK,gateway的中介
  • SDK 集成在业务系统中,用于发布消息,基于topic的订阅,可实现点对点或者广播消息推送
  • gateway Tornado WebSocket 服务器,并且实现了Hub用于中转消息

Example

MPC

python mpc.py -s 5559 -p 5560
  • s: MPC 面向SDK发布者的端口
  • p: MPC 面向gateway的端口

gateway

python gateway/server.py -r 127.0.0.1:5560 -p 8000
  • r: 对接MPC的pub socket
  • p: Tornado的WebSocket服务端口

SDK

from sdk import Publisher

pub = Publisher('127.0.0.1', 5559)
pub.send('ehr:api', 'hello world') # 话题, 消息

WebSocket

var s = new WebSocket('ws://localhost:8000/ws');

s.onopen = function(){
	this.send('{"event":"subscribe","topic":"ehr:api"}');
}

s.onmessage = function(v){
	console.log(v.data);
}

在建立WS连接后,需要发送订阅主题的action消息,SDK推送对应主题的消息,WS就会收到.

这里的订阅过程实现只是示例,具体的 认证/订阅/退订 的消息约定需要根据实际使用场景来设计.

比如需要发送推送消息:

pub = Publisher('127.0.0.1', 5559)
pub.send('ehr', 'hello world') # 话题, 消息

所有订阅了以ehr为前缀topic的WS都会收到该消息.

特性

  • 高并发
    • Tornado异步处理并发请求
    • pyzmq对Tornado异步回调的支持
    • Hub实现了订阅过程对MPC的解耦,通过inproc方式的订阅,支持更多订阅
  • 高性能
    • ZeroMQ高性能网络消息框架
  • 高可用
    • 得益于ZeroMQ的特性,无论是MPC SDK gateway 哪一个崩溃,都不会影响到整个消息系统的运行,只需要重启奔溃的部分即可
  • 伸缩扩容
    • 在当前gateway实例已经不能满足并发量的前提下,可以横向增加gateway的实例数,并不会提高MPC的并发压力,因为每个gateway实例与MPC只有1个pub/sub连接
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].