同步操作将从 开放金融技术/zbus 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
/\\\
\/\\\
\/\\\
/\\\\\\\\\\\ \/\\\ /\\\ /\\\ /\\\\\\\\\\
\///////\\\/ \/\\\\\\\\\ \/\\\ \/\\\ \/\\\//////
/\\\/ \/\\\////\\\ \/\\\ \/\\\ \/\\\\\\\\\\
/\\\/ \/\\\ \/\\\ \/\\\ \/\\\ \////////\\\
/\\\\\\\\\\\ \/\\\\\\\\\ \//\\\\\\\\\ /\\\\\\\\\\
\/////////// \///////// \///////// \////////// QQ Group: 467741880
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.
In zbus-dist directory, just run zbus.bat/sh, JDK8+ required.
Maven
<dependency>
<groupId>io.zbus</groupId>
<artifactId>zbus</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
zbus MQ protocol is pretty simple, just use websocket or http connect to zbus, send out the followsing json format data
{
cmd: pub|sub|create|remove|query|ping //Request required,
status: 200|400|404|403|500 ... //Response required,
body: <data>,
id: <message_id>,
apiKey: <apid_key>,
signature: <signature>
}
All requests to zbus should have id field (optional), when auth required, both apiKey and signature are required.
Signature generation algorithm
1) sort key ascending in request (recursively on both key and value), and generate json string
2) Init HmacSHA256 with secretKey, do encrypt on 1)'s json string to generate bytes
3) signature = Hex format in upper case on the 2)'s bytes
Request
{
cmd: pub, //required
mq: <mq_name>, //required
body: <business data>
}
Response
{
status: 200|400|403|500,
body: <string_response>
}
Request
{
cmd: sub, //required
mq: <mq_name>, //required
channel: <channel_name> //required
window: <window_size>
}
Response
First message: indicates subscribe success or failure
{
status: 200|400|403|500,
body: <string_response>
}
Following messages:
{
mq: <mq_name>, //required
channel: <channel_name> //required
sender: <message from>
id: <message id>
body: <business_data>
}
Request
{
cmd: take, //required
mq: <mq_name>, //required
channel: <channel_name> //required
window: <batch_size>
}
Response
{
status: 200|400|403|500|604, //604 stands for NO data
body: <data>
}
Request
{
cmd: create, //required
mq: <mq_name>, //required
mqType: memory|disk|db, //default to memory
mqMask: <mask_integer>,
channel: <channel_name>,
channelMask: <mask_integer>,
offset: <channel_offset>,
checksum: <offset_checksum>
topic: <channel_topic>,
}
Response
{
status: 200|400|403|500,
body: <message_response>
}
Request
{
cmd: remove, //required
mq: <mq_name>, //required
channel: <channel_name>
}
Response
{
status: 200|400|403|500,
body: <message_response>
}
Request
{
cmd: query, //required
mq: <mq_name>, //required
channel: <channel_name>
}
Response
{
status: 200|400|403|500,
body: <mq_channel_info>
}
Example
{
body: {
channels: [ ],
mask: 0,
name: "DiskQ",
size: 200000,
type: "disk"
},
status: 200
}
{
method: <method_name>, //required
params: [param_array],
module: <module_name>,
id: <message_id>,
apiKey: <apid_key>,
signature: <signature>
}
{
status: 200|400|403|500|604 //required
body: <data_or_exception>,
id: <message_id>
}
Fast performance test (Apache Benchmark)
Create MQ: http://localhost:15555?cmd=create&mq=MyMQ&mqType=disk
Produce
ab -k -c 32 -n 1000000 http://localhost:15555/?cmd=pub&mq=MyMQ
Create MQ: http://localhost:15555?cmd=create&mq=MyMQ&channel=MyChannel
Consume
ab -k -c 32 -n 1000000 http://localhost:15555?cmd=take&mq=MyMQ&channel=MyChannel
Single Mac i7 box with SSD
Produce: ~80,000/s
Consume: ~90,000/s
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。