BewareMyPower commented on issue #20022:
URL: https://github.com/apache/pulsar/issues/20022#issuecomment-1508004715
> In the failed message produce, the data -m '{"family" : "genus" }' should
have been rejected,
The schema validation only happens when the producer connects to the broker.
When the producer sends a message with wrong format, the message could still be
sent successfully. If you want to validate the schema when sending messages,
you should create an `AUTO_PRODUCE` producer. See
https://pulsar.apache.org/docs/2.11.x/schema-understand/#auto-schema
It seems that the Pulsar CLI cannot create an `AUTO_PRODUCE` producer
currently.
BTW, `isSchemaValidationEnforced` only enforces the schema validation for
bytes producer. i.e. a bytes producer cannot connect to a topic that already
has schema, if users want to send messages via raw bytes, they have to create
an `AUTO_PRODUCE` producer.
--
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]