Created
March 12, 2017 03:00
-
-
Save songyunlu/f13337d3303ed30b4898a947060d6f7c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.kafka.streams.kstream.KStreamBuilder; | |
import org.apache.kafka.streams.kstream.KStream; | |
import org.apache.kafka.streams.kstream.KTable; | |
KStreamBuilder builder = new KStreamBuilder(); | |
// Create a stream of page view events from the PageViews topic, where the key of | |
// a record is assumed to be the user id (String) and the value an Avro GenericRecord | |
// that represents the full details of the page view event. | |
KStream<String, GenericRecord> pageViews = builder.stream("PageViews"); | |
// Create a changelog stream for user profiles from the UserProfiles topic, | |
// where the key of a record is assumed to be the user id (String) and its value | |
// an Avro GenericRecord. | |
KTable<String, GenericRecord> userProfiles = builder.table("UserProfiles"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment