我在Nodejs中使用kafkajs和confluent-schema-registry。我可以记录message.value (avro),但在尝试解码时出现错误。显示: ResponseError: Confluent_Schema_Registry -错误,状态400
const payload = await registry.decode(message.value).catch(error => {
console.log('error consuming payload', error);
});发布于 2021-09-28 02:10:38
如果您的avro schema URL位于https上,请尝试在初始化SchemaRegistry期间指定代理。
const registry = new SchemaRegistry({
host: 'Your host on https',
// if you have auth for schema url
auth: {
username: 'username for schema url',
password: 'password for schema url'
},
// specifying below agent explicitly helped us
agent: new https.Agent({
rejectUnauthorized: false
})
})https://stackoverflow.com/questions/69316566
复制相似问题