开源中国 2018 年度最后一场技术盛会邀你来约~错过就要等明年啦!点此立即预约

GVPrushmore / zbusJavaMIT

Watch 686 Star 1.8k Fork 719
加入码云
与超过 300 万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
Small fast MQ/RPC and MicroWebAPI 展开 收起

RpcProtocol.md 929 Bytes
一键复制 编辑 Web IDE 原始数据 按行查看 历史
rushmore 提交于 2018-06-20 09:57 . update doc

RPC Protocol

Request

{ 
	headers: {
		id:        <message_id>,
		apiKey:    <apid_key>,
		signature: <signature>
	},
	url:      <function_url>  //[required]  
	method:   <http_method>,  //[optional]   
	body:     <param_array>   //[optional]
} 

function url can be any format of HTTP URL, if no configuration, following the simple mapping rules:

/${module}/${language_method_name}[/${param1}/${param2}/.....]

If body is populated in request, the params list in URL is ignored

If RPC is based on MQ, add MQ prefix in url,

/${mq}/${module}/${language_method_name}[/${param1}/${param2}/.....]

or, add 3 key-value pairs in headers

{
	cmd:      'pub',     
	mq:       <mq_name>,   //which MQ is the RPC based
	ack:      false        //No ACK from zbus for RPC
}

Response

{
	status:      200|400|403|404|500   //required
	body:        <data_or_exception>,
	id:          <message_id>
}

搜索帮助

12_float_left_people 12_float_left_close