You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
vpeddada-tibco
changed the title
Producer with JSON schema type doesn't throw an error if any extra parameter is passed in the message payload.
Producer with JSON schema type with RecordSchemaBuilder doesn't throw an error if any extra parameter is passed in the message payload.
May 9, 2023
@vpeddada Your point is good, but I am not sure this is not the role of the Broker to handle message validation. It can be a good feature to implement.
@vpeddada hi, can you provide the policy on the namespace like SchemaCompatibilityStrategy
And does you demo upload an json schema to create a producer, send a message by runtime create avro record, am i understanding right ? just want to know the demo background and try to reproduce your finding : - )
Pulsar does not validate the structure of JSON messages against the topic's schema. It only checks if the producer's schema definition matches the broker's topic schema. In contrast, the Avro schema validates the message structure during both encoding and decoding.
Search before asking
Version
Java Client(2.11.0)-->broker(2.11.0)
Broker instance OS: Amazon Linux 2023
Java App running OS : Windows 10
Minimal reproduce step
What did you expect to see?
As the message payload contains extra parameter Mobile the pulsar broker should reject the message and throw an error.
What did you see instead?
The message is acknowledged by the broker and send operation is successful.
Anything else?
We tried the same case with Avro schema type and it throws an error if any extra parameter is passed in the message payload.
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: