Configuration.handleMessageBody()
Description
Appends a handleMessageData filter to the current pipeline layout.
A handleMessageData filter calls back user scripts every time a complete message body (Data) is found in the input stream.
- INPUT - Any types of Events.
- OUTPUT - Same Events as input.
The user function that gets called will have a Data object as parameter.
This filter only calls the user function once for each message in the input stream. If the message's body is composed of multiple Data objects, handleMessageBody will wait until all Data objects composing a whole message are collected and call the user function with a combined Data object.
This filter passes everything down unaltered. It doesn't change anything in the event stream.
Syntax
pipy().pipeline().handleMessageBody(data => onMessageBody(data))
Parameters
handleMessageBody(handler)
A callback function that receives message bodies passing through the filter.
The same Configuration object.