aparajita89 commented on a change in pull request #14102:
URL: https://github.com/apache/pulsar/pull/14102#discussion_r803610970



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/SchemaRegistryService.java
##########
@@ -42,19 +44,29 @@
         return checkers;
     }
 
-    static SchemaRegistryService create(SchemaStorage schemaStorage, 
Set<String> schemaRegistryCompatibilityCheckers) {
+    static SchemaRegistryService create(String schemaRegistryName, 
SchemaStorage schemaStorage,
+          Set<String> schemaRegistryCompatibilityCheckers) {
         if (schemaStorage != null) {
             try {
                 Map<SchemaType, SchemaCompatibilityCheck> checkers = 
getCheckers(schemaRegistryCompatibilityCheckers);
                 checkers.put(SchemaType.KEY_VALUE, new 
KeyValueSchemaCompatibilityCheck(checkers));
-                return SchemaRegistryServiceWithSchemaDataValidator.of(
-                        new SchemaRegistryServiceImpl(schemaStorage, 
checkers));
+
+                if (schemaRegistryName == null) {
+                return SchemaRegistryServiceWithSchemaDataValidator
+                      .of(new SchemaRegistryServiceImpl(schemaStorage, 
checkers));
+                } else {
+                    return (SchemaRegistryService) 
Class.forName(schemaRegistryName)

Review comment:
       have updated this logic. we are using a default value in the config and 
continuing to use the schema validator wrapper class.
   the reasoning was that any custom schema registry implementation would need 
to comply with existing usages of SchemaRegistryService interface, including 
pulsar-admin apis and the client connection flows. the 
SchemaRegistryServiceWithSchemaDataValidator wrapper class ensures that any 
input schemas are validated via avro/json/protobuf-native parser before the 
compatibility checks and schema storage interactions are applied.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to