- Open the pom.xml in Intellij
- Select “Open as Project”
SET BOOTSTRAP_SERVERS=35.239.241.212:9092,35.239.230.132:9092,34.69.66.216:9092
export BOOTSTRAP_SERVER=35.239.241.212:9092,35.239.230.132:9092,34.69.66.216:9092
A topic exists called "question-1". Use the command line to describe the topic "question-1":
- How many partitions does it have?
- What is the replication factor?
- Hint: There is an example describe command in the
CLICommands.md
Using the Kafka CLI, create a topic with 3 partitions and a replication factor of 3. Call the topic " question-2-yourname".
A topic already exists called "question-3". Using SimpleConsumer
, what are the first ten messages at the beginning of
this topic?
Using SimpleProducer
, produce your name as a string to the topic "question-4". Verify it is there by
using SimpleConsumer
to read from the "question-4" topic
A topic exists called "question-5" with JSON strings as its messages. Using JSONConsumer
,
- Print out the string to understand the structure.
- Create a case class that matches this data structure.
- Parse the JSON string into the scala case class that you created.
What is the CAP theorem, and where does Kafka fit within it?