pyflink.datastream.connectors.kafka.KafkaSource#
- class KafkaSource(j_kafka_source: py4j.java_gateway.JavaObject)[source]#
The Source implementation of Kafka. Please use a
KafkaSourceBuilder
to construct aKafkaSource
. The following example shows how to create a KafkaSource emitting records of String type.>>> source = KafkaSource \ ... .builder() \ ... .set_bootstrap_servers('MY_BOOTSTRAP_SERVERS') \ ... .set_group_id('MY_GROUP') \ ... .set_topics('TOPIC1', 'TOPIC2') \ ... .set_value_only_deserializer(SimpleStringSchema()) \ ... .set_starting_offsets(KafkaOffsetsInitializer.earliest()) \ ... .build()
New in version 1.16.0.
Methods
builder
()Get a kafkaSourceBuilder to build a
KafkaSource
.get_java_function
()