apache / rocketmq-schema-registry

Apache RocketMQ Schema Registry
https://rocketmq.apache.org/
31 stars 20 forks source link

check avro schema compatibility by schema recordID during ser/de #63

Closed humkum closed 2 years ago

humkum commented 2 years ago

In serialize method, using reflection to get schema idl producer provided, and get the target schema from registry storage, and put the target schema recordID into the message head.

In deserializer, using the recordId decoded from message, to get the corresponding schema, and use the schema decode the message.

codecov-commenter commented 2 years ago

Codecov Report

Merging #63 (7213c0c) into main (98d7d9f) will increase coverage by 0.80%. The diff coverage is 26.13%.

@@             Coverage Diff              @@
##               main      #63      +/-   ##
============================================
+ Coverage     18.76%   19.56%   +0.80%     
- Complexity       56       65       +9     
============================================
  Files            45       45              
  Lines           906      966      +60     
  Branches         45       50       +5     
============================================
+ Hits            170      189      +19     
- Misses          723      759      +36     
- Partials         13       18       +5     
Impacted Files Coverage Δ
...ma/registry/client/NormalSchemaRegistryClient.java 0.00% <0.00%> (ø)
...a/registry/client/config/AvroSerializerConfig.java 100.00% <ø> (ø)
...ketmq/schema/registry/client/rest/RestService.java 0.00% <0.00%> (ø)
...try/client/serde/avro/GenericAvroDeserializer.java 66.66% <0.00%> (+66.66%) :arrow_up:
...ry/client/serde/avro/SpecificAvroDeserializer.java 0.00% <0.00%> (ø)
.../schema/registry/core/api/v1/SchemaController.java 0.00% <0.00%> (ø)
...chema/registry/core/service/SchemaServiceImpl.java 0.00% <0.00%> (ø)
...ema/registry/client/serde/avro/AvroSerializer.java 62.85% <28.57%> (-8.12%) :arrow_down:
...a/registry/client/serde/avro/GenericAvroSerde.java 66.66% <50.00%> (ø)
...istry/client/serde/avro/GenericAvroSerializer.java 72.72% <50.00%> (+72.72%) :arrow_up:
... and 4 more

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more