AndzejS3
(Andzej Sokolovski)
1
I need to read from Kafka with AVRO, but something is wrong with parsing.
Does Pega support deserializing AVRO logical types like decimal?
My example schema excerpt is this
{ “type”: “record”,
“name”: “example”,
“fields”: [
{ “name”: “myProperty”, “type”: { “type”: “bytes”, “logicalType”: “decimal”, “precision”: 5, “scale”: 3 } },
]
}
Result seems like parsing error {?} – attached
AndzejS3
(Andzej Sokolovski)
2
There was a hotfix provided by Pega for this use case HFIX-C1852. This fix will be included in Pega’25
Pega will not fully process the data, but will provide you with value like this: [ENC:BASE64]AIw=
This [ENC:BASE64]AIw= corresponds to 0.140 in my case
So here are the steps you need to do:
- decode from base64 to byte array
- convert bytes into hex and construct a string
- parse the string with something like Integer.decode()
- construct BigDecimal or whatever you need