Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] SchemaRegistryAvroSerializer Does Not Produce Same Avro as Javascript Serializer #22110

Closed
AsgerPilegaard opened this issue Jun 7, 2021 · 2 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Schema Registry
Milestone

Comments

@AsgerPilegaard
Copy link

Describe the bug
The java sdk SchemaRegistryAvroSerializer is not compatible with schemas uploaded by the javascript sdk SchemaRegistryHandler.

Main issue: The schema name, uploaded by the js SchemaRegistryHandler, does not contain the namespace only the name of the record.
Fact: The java SchemaRegistryAvroSerializer uses the full schema name from the local avro class to match with published schemas on the event hub schema registry.
Subsequent issue: The java SchemaRegistryAvroSerializer can not serialize/deserialize avro records using schemas published with js SchemaRegistryHandler.

Solution Idea:
Making the java sdk backward compatible with the js sdk would be the wrong solution, updating the js sdk would be the real fix.
As a minor flexibility fix, I suggest making the AvroSchemaRegistryUtils public and accessible in the SchemaRegistryAvroSerializerBuilder, enabling the caller to extend the AvroSchemaRegistryUtils class and overriding getSchemaName() method.

To Reproduce
Upload avro schemas using the js azure library "@azure/schema-registry": "^1.0.0-beta.1”.
Deserialize/serialize schemas using the java library “azure-data-schemaregistry-avro”: “1.0.0-beta.5”.

Code Snippet
String getSchemaName(Object object) {
return AvroSchemaUtils.getSchema(object).getFullName();
}

Expected behavior
AvroSchemaRegistryUtils should not be package private and accessible in the SchemaRegistryAvroSerializerBuilder.
The js SchemaRegistryHandler should upload schemas using the FullName (containing namespace).


@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jun 7, 2021
AsgerPilegaard pushed a commit to AsgerPilegaard/azure-sdk-for-java that referenced this issue Jun 7, 2021
Make the AvroSchemaRegistryUtils public and accessible in the SchemaRegistryAvroSerializerBuilder.
@alzimmermsft alzimmermsft added Client This issue points to a problem in the data-plane of the library. Schema Registry labels Jun 7, 2021
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Jun 7, 2021
@alzimmermsft alzimmermsft changed the title [BUG] [BUG] SchemaRegistryAvroSerializer Does Not Produce Same Avro as Javascript Serializer Jun 7, 2021
@alzimmermsft
Copy link
Member

Thank you for submitting this issue @AsgerPilegaard, would it be possible to also submit an issue against azure-sdk-for-js to track there as well.

@alzimmermsft alzimmermsft self-assigned this Jun 7, 2021
@alzimmermsft alzimmermsft assigned conniey and unassigned alzimmermsft Aug 16, 2021
@deyaaeldeen deyaaeldeen self-assigned this Aug 19, 2021
@ramya-rao-a ramya-rao-a added this to the [2022] February milestone Jan 12, 2022
azure-sdk pushed a commit to azure-sdk/azure-sdk-for-java that referenced this issue Mar 15, 2023
[Hub Generated] Review request for Microsoft.Devices to add version preview/2022-11-15-preview (Azure#22067)

* Adds base for updating Microsoft.Devices from version preview/2022-04-30-preview to version 2022-11-15-preview

* Updates readme

* Updates API version in new specs and examples

* Huangc 2022 11 15 preview (Azure#22110)

* update iothub example with ipversion and new api version of 2022-11-15-preview

* fix validation

* fix with adding location into lro header

* update manual failover json with adding azure-AsyncOperation

* remove location to see if pass the check

* fix

* fix

* fix

* fix with adding location

* Adding Azure-AsyncOperation to manualfailover

* test fix

* quick style fix for 2019-03-22

* update 2022-11-15-preview MF example
Copy link

Hi @AsgerPilegaard, we deeply appreciate your input into this project. Regrettably, this issue has remained inactive for over 2 years, leading us to the decision to close it. We've implemented this policy to maintain the relevance of our issue queue and facilitate easier navigation for new contributors. If you still believe this topic requires attention, please feel free to create a new issue, referencing this one. Thank you for your understanding and ongoing support.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 15, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Schema Registry
Projects
None yet
Development

No branches or pull requests

5 participants