Configuration.encodeRESP()
Description
Appends an encodeRESP filter to the current pipeline layout.
The encoder expects an input Message to have:
- head
- seqID - Sequence ID as a number
- type - Type of the message: "call", "reply", "exception" or "oneway"
- name - Name of the message
- protocol - Encoding protocol: "binary" or "compact"
- body - Payload of the message in raw binary
Syntax
pipy().pipeline().encodeThrift()
Parameters
encodeRESP()
Return Value
The same Configuration object.
Example
pipy().listen(9000).decodeThrift().demuxQueue({isOneWay: msg => msg.head.type === 'oneway',}).to($=>$.muxQueue({isOneWay: msg => msg.head.type === 'oneway',}).to($=>$.encodeThrift().connect('localhost:9090').decodeThrift())).encodeThrift()