处理http请求,通过RPC对控制http请求与响应,API是默认的处理器,它接收任何HTTP请求并转成指定格式的RPC请求。
- Content-Type: Any
- Body: Any
- Forward Format: api.Request/
- Path:
/[service]/[method]
- Resolver: 请求解析器,路径会被解析成服务与方法
Broker Handler
broker handler订阅分发处理器,以http的方式实现go-micro的分发接口服务
- Content-Type: Any
- Body: Any
- Forward Format: HTTP
- Resolver: 订阅主题通过query请求参数指定
- Content-Type: Any
- Body: Any
- Forward Format: 请求会按照格式化
- Path:
- Resolver: 请求路径会用来解析主题
Event Handler
事件处理器提供HTTP入口,把请求转成消息调用go-micro/client.Publish
方法通过消息总线发送出去。
- Content-Type: Any
- Body: Any
- Forward Format: 请求会按照格式化
- Path:
/[topic]/[event]
(可以看到与CloudEvents的不同) - Resolver: 请求路径会用来解析主题及事件名
Http处理器是HTTP的反向代理,内置在服务发现中。
- Content-Type: Any
- Body: Any
- Forward Format: 反向代理
- Path:
/[service]
Registry Handler
- Content-Type: Any
- Body: JSON
- Forward Format: HTTP
- Path:
- Resolver: 获取服务,注册与卸载服务分别通过GET, POST, DELETE请求处理。
RPC处理器接收JSON或protobuf的HTTP请求,并转成RPC请求向前转发。
- Content-Type:
application/json
orapplication/protobuf
- Body: JSON 或者 Protobuf
- Forward Format: json-rpc 或 proto-rpc,根据请求内容决定
- Path:
/[service]/[method]
- Resolver: 请求路径会用来解析服务名与方法名
Web Handler
web处理器职责是反射代理,它内置在服务发现中,并支持web socket。
- Content-Type: Any
- Body: Any
- Forward Format: 反向代理且支持web socket
- Path:
- Resolver: 请求路径会用来解析服务名