apache / apache/pulsar-client-node

Understanding in client how validation works when we define any schema in producer

Open
#411 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
164
Forks
98
PR merge metrics
No merged PRs in 30d

Description

in existing example if we see producer-schema.js where we are setting JSON schema for the topic by producer
and let say I enabled `enforceValidation` from pulsar-admin to true
so now I am expecting if producer is trying to send message which dosent not follow the schema client should throw an error validation failed
for example if producer is trying to send message
producer.send({
data: Buffer.from(JSON.stringify({"a":"testXYZ","b":1})),
});

for topic schema validation is already enabled
with below command

`bin/pulsar-admin namespaces set-schema-validation-enforce --enable tenant/namespace`

as we can see `a` should be integer but I am passing string
so I am expecting that pulsar or client should throw validation error instead of sending this message successfully?
same case from consumer side too

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the existing producer-schema.js example and the producer.send call shown in the issue. Reproduce the send with enforceValidation enabled using the provided pulsar-admin command, then check the corresponding consumer-side behavior. Done means the client behavior is confirmed and the expected validation result is clearly documented or tracked as a bug.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
backend, stream-processing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.