Best practices on validating messages in a consumer pipeline
Learn the best practices for passing messages between processes and validating messages received by a consumer.
Example scenario: Processing purchase orders in e-commerce
{
"status": 200,
"body": {
"orderNum": "001",
"products": [
{
"code": "123",
"name": "Product A"
},
{
"code": "456",
"name": "Product B"
}
],
"customer": {
"name": "Example Customer",
"cpf": "123.456.789-10",
"email": "[email protected]",
"addresses": {
"street": "Example Street",
"number": "10",
"zipCode": "01010-10"
}
}
},
"headers": {
"Cache-Control": "no-cache,must-revalidate,max-age=0,no-store,private",
"Content-Type": "application/json;charset=UTF-8",
"Date": "Wed, 01 Jul 2020 19:04:46 GMT",
"Expires": "Thu, 01 Jan 1970 00:00:00 GMT",
"Set-Cookie": "BrowserId=up7LXrwv46wesv5NEeg9ps_4AgB_",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
"Transfer-Encoding": "chunked",
"Vary": "Accept-Encoding",
"X-B3-Sampled": "0",
"X-B3-SpanId": "8c419a93i3bsi0=9d8e54316",
"X-B3-TraceId": "8c419a9389gba9y54316",
"X-Content-Type-Options": "nosniff",
"X-ReadOnlyMode": "false",
"X-XSS-Protection": "1; mode=block"
}
}Why avoid sending full JSON payloads?
PreviousAvoiding loops and maximizing pipeline efficiencyNextBest practices for error handling in pipelines
Last updated
Was this helpful?