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
# Clone the git repository | |
$ git clone https://github.com/confluentinc/cp-docker-images | |
# Change into the directory for this tutorial | |
$ cd cp-docker-images/examples/kafka-streams-examples | |
# Switch to the `v3.2.1` branch | |
$ git checkout v3.2.1 |
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
$ docker-compose up -d |
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
# List all running application instances of the Kafka Music application | |
$ curl -sXGET http://localhost:7070/kafka-music/instances | |
# You should see output similar to following, though here | |
# the output is pretty-printed so that it's easier to read: | |
[ | |
{ | |
"host": "localhost", | |
"port": 7070, | |
"storeNames": [ |
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
# Retrieve the latest Top 5 songs across all music genres | |
$ curl -sXGET http://localhost:7070/kafka-music/charts/top-five | |
# You should see output similar to following, though here | |
# the output is pretty-printed so that it's easier to read: | |
[ | |
{ | |
"artist": "Jello Biafra And The Guantanamo School Of Medicine", | |
"album": "The Audacity Of Hype", | |
"name": "Three Strikes", |
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
$ docker-compose down |
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
$ docker --version | |
Docker version 17.03.1-ce, build c6d412e | |
$ docker-compose --version | |
docker-compose version 1.11.2, build dfed245 | |
$ docker-machine --version | |
docker-machine version 0.10.0, build 76ed2a6 |
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.common.serialization.Serdes; | |
import org.apache.kafka.streams.KafkaStreams; | |
import org.apache.kafka.streams.StreamsConfig; | |
import org.apache.kafka.streams.kstream.KStream; | |
import org.apache.kafka.streams.kstream.KStreamBuilder; | |
import org.apache.kafka.streams.kstream.KTable; | |
import java.util.Arrays; | |
import java.util.Properties; |
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.common.serialization.Serdes; | |
import org.apache.kafka.streams.KafkaStreams; | |
import org.apache.kafka.streams.StreamsConfig; | |
import org.apache.kafka.streams.kstream.KStream; | |
import org.apache.kafka.streams.kstream.KStreamBuilder; | |
import org.apache.kafka.streams.kstream.KTable; | |
import java.util.Arrays; | |
import java.util.Properties; | |
import java.util.concurrent.TimeUnit; |
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.common.serialization.Serdes; | |
import org.apache.kafka.streams.KafkaStreams; | |
import org.apache.kafka.streams.StreamsConfig; | |
import org.apache.kafka.streams.kstream.KStream; | |
import org.apache.kafka.streams.kstream.KStreamBuilder; | |
import org.apache.kafka.streams.kstream.KTable; | |
import java.util.Arrays; | |
import java.util.Properties; |
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 java.lang.Long | |
import java.util.Properties | |
import java.util.concurrent.TimeUnit | |
import org.apache.kafka.common.serialization._ | |
import org.apache.kafka.streams._ | |
import org.apache.kafka.streams.kstream.{KStream, KStreamBuilder, KTable} | |
import scala.collection.JavaConverters.asJavaIterableConverter |