apache / apache/pulsar-client-node

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

未关闭
#411 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
C++
星标
164
派生
99
PR 合并指标
30 天内没有已合并 PR

描述

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

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从现有的 producer-schema.js 示例和 issue 中所示的 producer.send 调用开始。使用提供的 pulsar-admin 命令,在启用 enforceValidation 的情况下重现发送操作,然后检查相应的 consumer 端行为。当客户端行为得到确认,并且预期的验证结果已得到明确记录或作为 bug 跟踪时,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript, nodejs
领域
backend, stream-processing
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
30/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。