-
Notifications
You must be signed in to change notification settings - Fork 27
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
Make Schema Registry Subjects configurable #29
base: master
Are you sure you want to change the base?
Make Schema Registry Subjects configurable #29
Conversation
… ZK lib in provided scope. Added property for jersey.bean.validation version
…r destination Schema Registry
…tegy and TopicRecordNameSubjectStrategy
…alue.subject.name.strategy parameters
// TODO: Make the Strategy configurable, may be different for src and dest | ||
// Strategy for the -key and -value subjects | ||
this.subjectNameStrategy = new TopicNameStrategy(); | ||
// Strategy for the subjects | ||
this.keySubjectNameStrategy = createSubjectStrategy(config.getString(ConfigName.KEY_SUBJECT_NAME_STRATEGY)); | ||
this.valueSubjectNameStrategy = createSubjectStrategy(config.getString(ConfigName.VALUE_SUBJECT_NAME_STRATEGY)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry it took me so long to review this.
Were you not able to make the source and destination use differing strategies? Or do you think that use case would ultimately cause confusion?
<confluent.patch.version>-cp1</confluent.patch.version> | ||
<jackson.version>2.9.7</jackson.version> | ||
<jackson.asl.version>1.9.13</jackson.asl.version> | ||
<confluent.version>5.5.0</confluent.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be possible to implement the feature without upgrades, IMO.
Can the version bump be a separate PR?
assertTrue(destKeyVersions.isEmpty(), "the destination registry starts empty"); | ||
List<Integer> destValueVersions = destClient.getAllVersions(destValueSubject); | ||
assertTrue(destValueVersions.isEmpty(), "the destination registry starts empty"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: The message needs changed since you've already registered something in the destination
String destKeySubject = TOPIC + "-" + keySchema.name(); | ||
//value subject in destination schema registry is topic-record name, NOT default topicName-value | ||
String destValueSubject = TOPIC + "-" + valueSchema.name(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to use TopicRecordNameStrategy
to create these rather than manually?
log.info("Registering schemas in source registry"); | ||
int sourceKeyId = sourceSchemaRegistry.registerSchema(TOPIC, true, keySchema); | ||
final String keySubject = TOPIC + "-key"; | ||
assertEquals(1, sourceKeyId, "An empty registry starts at id=1"); | ||
int sourceValueId = sourceSchemaRegistry.registerSchema(TOPIC, false, valueSchema); | ||
final String valueSubject = TOPIC + "-value"; | ||
assertEquals(2, sourceValueId, "unique schema ids monotonically increase"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth adding some comment that this is using TopicNameStrategy
?
@@ -152,22 +154,22 @@ public void beforeEach(final ExtensionContext context) { | |||
.willReturn(WireMock.aResponse().withTransformers(this.getVersionHandler.getName()))); | |||
this.stubFor.apply(WireMock.get(WireMock.urlPathMatching(CONFIG_PATTERN)) | |||
.willReturn(WireMock.aResponse().withTransformers(this.getConfigHandler.getName()))); | |||
this.stubFor.apply(WireMock.get(WireMock.urlPathMatching(SCHEMA_BY_ID_PATTERN + "\\d+")) | |||
this.stubFor.apply(WireMock.get(WireMock.urlPathMatching(SCHEMA_BY_ID_PATTERN + "\\d+/(?:fetchMaxId=false)")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont think the capture group is necessary
Fixes #2
Was planning to make this PR after #26 is merged, but doing it anyway.