明确指定 KSQL 流主题名称 [英] Specify KSQL Stream Subject names explicitly
问题描述
我有两个 KSQL 主题 my-topic-1
和 my-topic-2
,消息通过 AVRO 序列化.由于历史原因,my-topic-1
模式不是推荐的 topic-value
格式,而是 my-custom-subject-name
代码>.
I have two KSQL topics my-topic-1
and my-topic-2
, with messages serialised via AVRO. For historical reasons, the my-topic-1
schema is not in the recommended topic-value
format, but is instead my-custom-subject-name
.
我想通过 KSQL 将记录从一个主题移动到另一个主题.
I want to move records from one topic to the other via KSQL.
首先,让我们创建一个流:
First up, let's create a stream:
CREATE STREAM my-stream-1
WITH (KAFKA_TOPIC='my-topic-1', VALUE_FORMAT='AVRO');
糟糕:
Avro schema for message values on topic my-topic-1 does not exist in the Schema Registry.
Subject: my-topic-1-value
Possible causes include:
- The topic itself does not exist
-> Use SHOW TOPICS; to check
- Messages on the topic are not Avro serialized
-> Use PRINT 'my-topic-1' FROM BEGINNING; to verify
- Messages on the topic have not been serialized using the Confluent Schema Registry Avro serializer
-> See https://docs.confluent.io/current/schema-registry/docs/serializer-formatter.html
- The schema is registered on a different instance of the Schema Registry
-> Use the REST API to list available subjects
https://docs.confluent.io/current/schema-registry/docs/api.html#get--subjects
它正在寻找主题 my-topic-1-value
有没有人知道这是否可能?VALUE_AVRO_SCHEMA_FULL_NAME
提到了 这里 不符合我的要求.
Does anyone have any idea if this is possible? VALUE_AVRO_SCHEMA_FULL_NAME
mentioned here doesn't do what I want it to.
推荐答案
这似乎是一个错误.我已经更新了 https://github.com/confluentinc/ksql/issues/3188 用一个例子来重现.我建议我们在那里跟踪它.
This appears to be a bug. I've updated https://github.com/confluentinc/ksql/issues/3188 with an example to reproduce. I suggest we track it there.
这篇关于明确指定 KSQL 流主题名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!