Creating Data Pipe Lines With Kafka
Creating Data Pipe Lines With Kafka
B6/702/A
Introduction
Chapter 1
Introduction
▪ Introduction
06: Conclusion
06: Conclusion
06: Conclusion
key.converter=io.confluent.connect.avro.AvroConverter
key.converter.schema.registry.url=http://schemaregistry1:8081
value.converter=io.confluent.connect.avro.AvroConverter
value.converter.schema.registry.url=http://schemaregistry1:8081
▪ Benefits
– Provides a data structure format
– Supports code generation of data types
– Avro data is binary, so stores data efficiently
– Type checking is performed at write time
▪ Avro schemas evolve as updates to code happen
– Connectors may support schema evolution and react to schema changes in a
configurable way
▪ Schemas can be centrally managed in a Schema Registry
$ connect-standalone connect-standalone.properties \
connector1.properties [connector2.properties connector3.properties ...]
$ connect-distributed worker.properties
▪ Group coordination
– Connect leverages Kafka’s group membership protocol
– Configure workers with the same group.id
06: Conclusion
▪ If we were to treat the stream as a KStream and sum up the values for apple, the
result would be 6
▪ If we were to treat the stream as a KTable and sum up the values for apple, the
result would be 5
– The second record is treated as an update to the first, because they have the same
key
▪ Typically, if you are going to treat a topic as a KTable it makes sense to configure
log compaction on the topic
Copyright © 2015, 2016, 2017 Confluent, Inc. All rights reserved.
05-13
Not to be reproduced in any form without prior written consent.
KStreams and KTables: Example
streamsConfiguration.put(StreamsConfig.KEY_SERDE_CLASS_CONFIG, Serdes.String().getClass().
getName());
streamsConfiguration.put(StreamsConfig.VALUE_SERDE_CLASS_CONFIG, Serdes.Long().getClass().
getName());
▪ Example:
myNewStream.to("NewTopic");
▪ We often want to write to a topic but then continue to process the data
– Do this using the through method
myNewStream.through("NewTopic").flatMap(...)...;
Presented by