类 KafkaBytesSource
- java.lang.Object
-
- org.apache.pulsar.io.core.PushSource<V>
-
- org.apache.pulsar.io.kafka.KafkaAbstractSource<java.nio.ByteBuffer>
-
- org.apache.pulsar.io.kafka.KafkaBytesSource
-
- 所有已实现的接口:
java.lang.AutoCloseable,org.apache.pulsar.io.core.Source<java.nio.ByteBuffer>
public class KafkaBytesSource extends KafkaAbstractSource<java.nio.ByteBuffer>
Kafka Source that transfers the data from Kafka to Pulsar and sets the Schema type properly. We use the key and the value deserializer in order to decide the type of Schema to be set on the topic on Pulsar. In case of KafkaAvroDeserializer we use the Schema Registry to download the schema and apply it to the topic. Please refer togetSchemaFromDeserializerAndAdaptConfiguration(String, Properties, boolean)for the list of supported Deserializers. If you set StringDeserializer for the key then we use the raw key as key for the Pulsar message. If you set another Deserializer for the key we use the KeyValue schema type in Pulsar with the SEPARATED encoding. This way the Key is stored in the Pulsar key, encoded as base64 string and with a Schema, the Value of the message is stored in the Pulsar value with a Schema. This way there is a one-to-one mapping between Kafka key/value pair and the Pulsar data model.
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static classKafkaBytesSource.ExtractKafkaAvroSchemaDeserializer-
从类继承的嵌套类/接口 org.apache.pulsar.io.kafka.KafkaAbstractSource
KafkaAbstractSource.KafkaRecord<V>, KafkaAbstractSource.KeyValueKafkaRecord<V>
-
-
构造器概要
构造器 构造器 说明 KafkaBytesSource()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected java.util.PropertiesbeforeCreateConsumer(java.util.Properties props)KafkaAbstractSource.KafkaRecordbuildRecord(org.apache.kafka.clients.consumer.ConsumerRecord<java.lang.Object,java.lang.Object> consumerRecord)-
从类继承的方法 org.apache.pulsar.io.kafka.KafkaAbstractSource
close, open, start
-
-
-
-
方法详细资料
-
beforeCreateConsumer
protected java.util.Properties beforeCreateConsumer(java.util.Properties props)
- 覆盖:
beforeCreateConsumer在类中KafkaAbstractSource<java.nio.ByteBuffer>
-
buildRecord
public KafkaAbstractSource.KafkaRecord buildRecord(org.apache.kafka.clients.consumer.ConsumerRecord<java.lang.Object,java.lang.Object> consumerRecord)
- 指定者:
buildRecord在类中KafkaAbstractSource<java.nio.ByteBuffer>
-
-