明确指定KSQL流主题名称

时间:2019-12-05 11:26:36

标签: apache-kafka avro ksql

我有两个KSQL主题my-topic-1my-topic-2,并通过AVRO序列化了消息。由于历史原因,my-topic-1模式不是推荐的topic-value格式,而是my-custom-subject-name

我想通过KSQL将记录从一个主题移到另一个主题。

首先,让我们创建一个流:

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提到了here并没有达到我想要的目的。

1 个答案:

答案 0 :(得分:1)

这似乎是一个错误。我用一个示例更新了https://github.com/confluentinc/ksql/issues/3188以便重现。我建议我们在那里追踪。