[
https://issues.apache.org/jira/browse/FLINK-14002?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16929556#comment-16929556
]
Elias Levy commented on FLINK-14002:
------------------------------------
Came here to open just tis ticket. {{KeyedSerializationSchema}} was deprecated
but {{KafkaSerializationSchema}} was not very well thought out. A
{{KafkaSerializationSchema}} that implements {{KafkaContextAware}} can return
null from {{getTargetTopic}}, and that will result in the sink using the
default topic to look up the partition information, but the
{{KeyedSerializationSchema}} still needs to fill in the topic in the
{{ProducerRecord}} or it will result in an exception.
Having a serializer that is lower-level and can create a `ProducerRecord` is
nice, but IMHO we should have not have deprecated the simpler higher-level
serializer.
> FlinkKafkaProducer constructor that takes KafkaSerializationSchema shouldnt
> take default topic
> ----------------------------------------------------------------------------------------------
>
> Key: FLINK-14002
> URL: https://issues.apache.org/jira/browse/FLINK-14002
> Project: Flink
> Issue Type: Improvement
> Components: Connectors / Kafka
> Reporter: Gyula Fora
> Priority: Major
>
> When the KafkaSerializationSchema is used the user has the to provide the
> topic always when they create the ProducerRecord.
> The defaultTopic specified in the constructor (and enforced not to be null)
> will always be ignored, this is very misleading.
> We should depracate these constructors and create new ones without
> defaultTopic.
--
This message was sent by Atlassian Jira
(v8.3.2#803003)