博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
OPQ - 开源持久化消息队列
阅读量:7223 次
发布时间:2019-06-29

本文共 1883 字,大约阅读时间需要 6 分钟。

OPQ

  • An Open sourced Persistent message Queue
  • Code is tested under go1.4.2 (CAUTION: OPQ hasn't been tested in production environment so far)
  • Features
    1.persistent message storage
    2.push model - push message to target service and block when failure
    3.easy to use - simple API whith HTTP POST method, no addtional client integration is required
    4.message replay
    5.high performance aimed
    6.operations-friendly - graceful stop/restart, HA (TODO)
  • Performance
    1.over 20,000(Message/Second) with 2K(Byte) message payload
    2.over 30,000(Message/Second) with 1K(Byte) message payload

Install

Download source code

go get -u github.com/LevinLin/OPQ

Build OPQ

cd /path/to/OPQgo build

Run OPQ

cd /path/to/OPQnohup ./OPQ &>/dev/null &

-debug

System runs in debug model when given debug=yes, which will enable log/output in debug level, default to no

-port

Listening port, default to 8999

-syslog

System log name, default to system.log

-admin

Enable admin portal when given admin=yes, default to no (TODO, not available yet)

Gracefully restart OPQ

kill -1 %{PID}

Usage

  • Push Message
    url: http://%{SERVER_NAME}[:%{SERVER_PORT}]/opq/push
    post fields:
    1.url: target url
    2.topic: each message should belong to a topic
    3.message: message content
    header: specify the header if you need
    example:(PHP)
    'http://127.0.0.1/Comment/addComment?comment=nny&user=q18', 'topic'=> 'comment', 'message'=> 'this is message body', ); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $response = curl_exec($ch); var_dump($response); curl_close($ch);
  • Replay Message
    url: http://%{SERVER_NAME}[:%{SERVER_PORT}]/opq/replay
    post fields:
    1.topic: topic name
    2.cmd: commond number (message index, start from 0)
    example:(PHP)
    'comment', 'cmd'=> '30', ); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $response = curl_exec($ch); var_dump($response); curl_close($ch);

转载于:https://www.cnblogs.com/levinlin/p/6733127.html

你可能感兴趣的文章
电子病历,到底是用BS还是CS
查看>>
Visual Studio (VSIX,项目模板 )制作
查看>>
两个人的荒岛
查看>>
机器学习经典书籍
查看>>
[nginx] nginx安装
查看>>
[转].NET 绘制 EAN13 (商品条码)
查看>>
【转】越狱的 iPhone、iPad 通过网站实现一键安装 ipa 格式的 APP 应用
查看>>
开发者的利器:Docker 理解与使用
查看>>
mybatis调用视图和存储过程
查看>>
Nested loops、Hash join、Sort merge join(三种连接类型原理、使用要点)
查看>>
RT-Thread的线程(任务)处理 rt_thread_create/rt_thread_init区别
查看>>
为什么需要单元测试
查看>>
[原]shell中的三个零碎知识
查看>>
piix4_smbus 0000:00:07.0: SMBus base address uninitialized - upgrade BIOS or use force_addr=0xaddr
查看>>
操作MSSQL服务还有测试是否连接
查看>>
vim命令拾遗[zz]
查看>>
简单PHP留言板之七 —— 附加上css样式表
查看>>
数据库开发篇(一)——转换日期类型
查看>>
php 燕十八 观察者模式代码例子
查看>>
利用Android Lost通过互联网或短信远程控制安卓设备
查看>>