Apache Kafka Quick Start Guide

Book description

Process large volumes of data in real-time while building high performance and robust data stream processing pipeline using the latest Apache Kafka 2.0

Key Features

  • Solve practical large data and processing challenges with Kafka
  • Tackle data processing challenges like late events, windowing, and watermarking
  • Understand real-time streaming applications processing using Schema registry, Kafka connect, Kafka streams, and KSQL

Book Description

Apache Kafka is a great open source platform for handling your real-time data pipeline to ensure high-speed filtering and pattern matching on the ?y. In this book, you will learn how to use Apache Kafka for efficient processing of distributed applications and will get familiar with solving everyday problems in fast data and processing pipelines.

This book focuses on programming rather than the configuration management of Kafka clusters or DevOps. It starts off with the installation and setting up the development environment, before quickly moving on to performing fundamental messaging operations such as validation and enrichment.

Here you will learn about message composition with pure Kafka API and Kafka Streams. You will look into the transformation of messages in different formats, such asext, binary, XML, JSON, and AVRO. Next, you will learn how to expose the schemas contained in Kafka with the Schema Registry. You will then learn how to work with all relevant connectors with Kafka Connect. While working with Kafka Streams, you will perform various interesting operations on streams, such as windowing, joins, and aggregations. Finally, through KSQL, you will learn how to retrieve, insert, modify, and delete data streams, and how to manipulate watermarks and windows.

What you will learn

  • How to validate data with Kafka
  • Add information to existing data ?ows
  • Generate new information through message composition
  • Perform data validation and versioning with the Schema Registry
  • How to perform message Serialization and Deserialization
  • How to perform message Serialization and Deserialization
  • Process data streams with Kafka Streams
  • Understand the duality between tables and streams with KSQL

Who this book is for

This book is for developers who want to quickly master the practical concepts behind Apache Kafka. The audience need not have come across Apache Kafka previously; however, a familiarity of Java or any JVM language will be helpful in understanding the code in this book.

Table of contents

  1. Title page
  2. Copyright and Credits
    1. Apache Kafka Quick Start Guide
  3. Dedication
  4. About Packt
    1. Why subscribe?
    2. Packt.com
  5. Contributors
    1. About the author
    2. About the reviewer
    3. Packt is searching for authors like you
  6. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Conventions used
    4. Get in touch
      1. Reviews
  7. Configuring Kafka
    1. Kafka in a nutshell
    2. Kafka installation
      1. Kafka installation on Linux
      2. Kafka installation on macOS
      3. Confluent Platform installation
    3. Running Kafka
    4. Running Confluent Platform
    5. Running Kafka brokers
    6. Running Kafka topics
    7. A command-line message producer
    8. A command-line message consumer
    9. Using kafkacat
    10. Summary
  8. Message Validation
    1. Enterprise service bus in a nutshell
    2. Event modeling
    3. Setting up the project
    4. Reading from Kafka
    5. Writing to Kafka
    6. Running the processing engine
    7. Coding a validator in Java
    8. Running the validation
    9. Summary
  9. Message Enrichment
    1. Extracting the geographic location
    2. Enriching the messages
    3. Extracting the currency price
    4. Enriching with currency price
    5. Running the engine
    6. Extracting the weather data
    7. Summary
  10. Serialization
    1. Kioto, a Kafka IoT company
    2. Project setup
    3. The constants
    4. HealthCheck message
    5. Java PlainProducer
    6. Running the PlainProducer
    7. Java plain consumer
    8. Java PlainProcessor
    9. Running the PlainProcessor
    10. Custom serializer
    11. Java CustomProducer
    12. Running the CustomProducer
    13. Custom deserializer
    14. Java custom consumer
    15. Java custom processor
    16. Running the custom processor
    17. Summary
  11. Schema Registry
    1. Avro in a nutshell
    2. Defining the schema
    3. Starting the Schema Registry
    4. Using the Schema Registry
      1. Registering a new version of a schema under a – value subject
      2. Registering a new version of a schema under a – key subject
      3. Registering an existing schema into a new subject
      4. Listing all subjects
      5. Fetching a schema by its global unique ID
      6. Listing all schema versions registered under the healthchecks–value subject
      7. Fetching version 1 of the schema registered under the healthchecks-value subject
      8. Deleting version 1 of the schema registered under the healthchecks-value subject
      9. Deleting the most recently registered schema under the healthchecks-value subject
      10. Deleting all the schema versions registered under the healthchecks–value subject
      11. Checking whether a schema is already registered under the healthchecks–key subject
      12. Testing schema compatibility against the latest schema under the healthchecks–value subject
      13. Getting the top-level compatibility configuration
      14.  Globally updating the compatibility requirements
      15. Updating the compatibility requirements under the healthchecks–value subject
    5. Java AvroProducer
    6. Running the AvroProducer
    7. Java AvroConsumer
    8. Java AvroProcessor
    9. Running the AvroProcessor
    10. Summary
  12. Kafka Streams
    1. Kafka Streams in a nutshell
    2. Project setup
    3. Java PlainStreamsProcessor
    4. Running the PlainStreamsProcessor
    5. Scaling out with Kafka Streams
    6. Java CustomStreamsProcessor
    7. Running the CustomStreamsProcessor
    8. Java AvroStreamsProcessor
    9. Running the AvroStreamsProcessor
    10. Late event processing
    11. Basic scenario
    12. Late event generation
    13. Running the EventProducer
    14. Kafka Streams processor
    15. Running the Streams processor
    16. Stream processor analysis
    17. Summary
  13. KSQL
    1. KSQL in a nutshell
    2. Running KSQL
    3. Using the KSQL CLI
    4. Processing data with KSQL
    5. Writing to a topic
    6. Summary
  14. Kafka Connect
    1. Kafka Connect in a nutshell
    2. Project setup
    3. Spark Streaming processor
    4. Reading Kafka from Spark
    5. Data conversion
    6. Data processing
    7. Writing to Kafka from Spark
    8. Running the SparkProcessor
    9. Summary
  15. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think

Product information

  • Title: Apache Kafka Quick Start Guide
  • Author(s): Raul Estrada
  • Release date: December 2018
  • Publisher(s): Packt Publishing
  • ISBN: 9781788997829