-
Notifications
You must be signed in to change notification settings - Fork 67
Add support for AUTO_PRODUCE schema #572
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
Conversation
This commit adds support for producing raw JSON or Avro payloads with AUTO_SCHEMA.
@@ -14,7 +14,7 @@ | |||
:spring-cloud-stream-docs: https://docs.spring.io/spring-cloud-stream/docs/{spring-cloud-stream-version}/reference/html/ | |||
:spring-cloud-function: https://spring.io/projects/spring-cloud-function | |||
|
|||
:apache-pulsar-docs: https://pulsar.apache.org/docs/3.1.x | |||
:apache-pulsar-docs: https://pulsar.apache.org/docs/3.2.x |
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.
[UNRELATED] Bump in docs to current version
@@ -193,7 +197,8 @@ static class ProducerCacheKey<T> { | |||
Assert.notNull(schema, () -> "'schema' must be non-null"); | |||
Assert.notNull(topic, () -> "'topic' must be non-null"); | |||
this.schema = schema; | |||
this.schemaHash = SchemaHash.of(this.schema); | |||
this.schemaHash = (schema instanceof AutoProduceBytesSchema) ? AUTO_PRODUCE_SCHEMA_HASH |
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.
This is necessary as any call to AutoProduceSchema.getSchemaInfo()
will throw RuntimeException on the client until after something has been sent and validated w/ the target topic (i.e a schema is initialized on it). In our case, we don't care about schema info, the producer can be used for any byte[]
messages that the user wants to be validated against the target topic schema and this cache key will do that.
@@ -74,7 +75,7 @@ void cleanupFromTests() { | |||
} | |||
|
|||
@Test | |||
void createProducerMultipleCalls() throws PulsarClientException { |
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.
[UNRELATED] Leftover from removal of checked exception in Spring Pulsar APIs.
This commit adds support for producing raw JSON or Avro payloads with AUTO_SCHEMA.