以下为客户端的微服务配置结构:
return [
// 路由名称
'order/create' => [
// 多个连接池
[
'title' => '30机器', // 节点名称
'ip' => '127.0.0.1', // 节点IP
'port' => '9502', // 节点端口
'protocol' => 'TCP | HTTP', // 请求类型,TCP则启用TCP链接,HTTP则直接CURL连接(这个可能不兼容,直接用TCP就好)
'secret_key' => 'sw-x', // 访问密钥
'is_fault' => 0, // 当前节点是否已故障 0.否 1.是
'score' => 100, // 评分,100分满分
'ping_ms' => 43, // PING 延迟
'request_num' => 0, // 当前任务数
]
],
];
以下为客户端的请求数据包结构:
return [
'class' => 'order/create', // 路由
'function' => 'run', // 方法
'secret_key' => '密钥', // 密钥
'headers' => [], // 请求头
'param' => [], // 请求参数
];