Configuration.decodeDubbo()
Description
Appends a decodeDubbo filter to the current pipeline layout.
A decodeDubbo filter decodes Dubbo messages from a raw byte stream.
- INPUT - Data stream to decode Dubbo messages from.
- OUTPUT - Dubbo Messages decoded from the input Data stream.
After decoding, the output Message has:
- head
- id - Request ID as a string
- status - Status code
- isRequest - Is it a request?
- isTwoWay - Is it 2-way?
- isEvent - Is it an event?
- body - Binary data in the body
The body data is a Data object left without being decoded. To decode it, use Hessian.decode().
Syntax
pipy().pipeline().decodeDubbo()
Parameters
decodeDubbo()
Return Value
The same Configuration object.
Example
pipy().listen(20880).decodeDubbo().demuxQueue().to($=>$.replaceMessageBody(data => (JSON.encode(Hessian.decode(data)))).muxHTTP().to($=>$.connect('localhost:8080')).replaceMessageBody(data => (Hessian.encode(JSON.decode(data))))).encodeDubbo({isRequest: false,})