Configuration.encodeBGP()
Description
Appends a encodeBGP filter to the current pipeline layout.
The encoder expects an input Message to have:
- 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 and will be left unchanged after encoding. To produce data in Hessian format, use Hessian.encode().
Syntax
pipy().pipeline().encodeDubbo()
Parameters
encodeBGP(options?)
options?
No description
Return Value
The same Configuration object.
Example
pipy().listen(20880).decodeDubbo().demux().to($=>$.replaceMessageBody(data => (JSON.encode(Hessian.decode(data)))).muxHTTP().to($=>$.connect('localhost:8080')).replaceMessageBody(data => (Hessian.encode(JSON.decode(data))))).encodeDubbo({isRequest: false,})