#132 Payload: Compression

9.9.9.9: Backlog
open
nobody
Payload (2)
2021-03-31
2021-03-31
i-campbell
No

There is a non-normative compression practice in the Tahu project.
https://github.com/eclipse/tahu/blob/develop/client_libraries/java/src/main/java/org/eclipse/tahu/util/PayloadUtil.java

Essentially, you
1. compress the payload to an array of bytes using GZIP or DEFLATE.
2. This array of bytes is put in the payload.body.
3. Optionally, a single payload.metrics named "algorithm", of datatype String contains the string_value either "GZIP" or "DEFLATE". If this is not included, then "DEFLATE" will be assumed.
4. paylaod.uuid contains the text "SPBV1.0_COMPRESSED"

eg.

{"timestamp": 16000000000,
 "metrics": [{"name": "algorithm",
              "timestamp": 16000000000,
              "datatype": "String",
              "string_value": "GZIP"}],
 "seq": 12,
 "uuid": "SPBV1.0_COMPRESSED",
 "body": <GZIP compressed bytes of the actual payload>
}

or

{"timestamp": 16000000000,
 "seq": 12,
 "uuid": "SPBV1.0_COMPRESSED",
 "body": <DEFLATE compressed bytes of the actual payload>
}

Discussion


Log in to post a comment.