DefaultDataTransformer class
The default data transformer that will be used by the Azure SDK.
Methods
| decode(any) | A function that takes the body property from an AMQP message (an AMQP Data type (data section in rhea terms)) and returns the decoded message body. If it cannot decode the body then it returns the body as-is. |
| encode(any) | A function that takes the body property from an EventData object and returns an encoded body (some form of AMQP type). |
Method Details
decode(any)
A function that takes the body property from an AMQP message (an AMQP Data type (data section in rhea terms)) and returns the decoded message body. If it cannot decode the body then it returns the body as-is.
function decode(body: any): any
Parameters
- body
-
any
The AMQP message body
Returns
any
decoded body or the given body as-is.
encode(any)
A function that takes the body property from an EventData object and returns an encoded body (some form of AMQP type).
function encode(body: any): any
Parameters
- body
-
any
The AMQP message body
Returns
any
encodedBody - The encoded AMQP message body as an AMQP Data type (data section in rhea terms). Section object with following properties:
- typecode: 117 (0x75)
- content: The given AMQP message body as a Buffer.
- multiple: true | undefined.