Configuration.decodeRESP()
Description
Appends a decodeRESP filter to the current pipeline layout.
After decoding, the output Message has:
- 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
- tail
- payload - Payload of the message decoded as an object (only when option payload is set to true)
Syntax
pipy().pipeline().decodeThrift()pipy().pipeline().decodeThrift({payload: true})
Parameters
decodeRESP()
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()