Closed shiyao-afterpay closed 3 years ago
Hiya, by default codec caching is false, you can set it to enabled, please elaborate if this does not solve your issue.
Did you mean enabled at goavro or at ?
I can see new codec are created every time: https://github.com/riferrei/srclient/blob/master/schemaRegistryClient.go#L159
If schema is already cached and schema caching is enabled, result will be returned at https://github.com/riferrei/srclient/blob/7be54965ba084e38873753d4faac0d4c1aad4540/schemaRegistryClient.go#L144
If schema is not cached, and schema caching is enabled, it will be cached at https://github.com/riferrei/srclient/blob/7be54965ba084e38873753d4faac0d4c1aad4540/schemaRegistryClient.go#L173
Before schema is cached, if codec creation is enabled, it will be created at https://github.com/riferrei/srclient/blob/7be54965ba084e38873753d4faac0d4c1aad4540/schemaRegistryClient.go#L160 and then added to the schema at https://github.com/riferrei/srclient/blob/7be54965ba084e38873753d4faac0d4c1aad4540/schemaRegistryClient.go#L168 which will ensure codec pointer is part of the schema before it is cached, so the codec is also created once. I'm closing this issue unless there is something else.
You are right. Missed that Schema has a Codec field. So Codec is also cached.
It seems schema can be cached, but not the corresponding codec.