Share E-Book
Scan to open this page

Scan with your phone to open this page

AuthorWilliam P. Bejeck Jr.

No description

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
# Kafka Streams in Action (Second Edition) — Reading Guide ## 【One-Line Pitch】 A practical, hands-on guide to building event-driven applications and microservices with Kafka, covering everything from brokers and clients to stream processing—ideal for Java developers who want to move from theory to working code quickly. ## 【Book Arc】 - **Opening (~0%–10%)**: Introduces the Kafka event streaming platform, contrasting messages (tactical, machine-to-machine) with events (business-critical data worth preserving), and sets up the Docker-based development environment used throughout. - **Early (~10%–23%)**: Walks through broker fundamentals—produce/consume requests, partitions, replication, and metadata management—then pivots to schema design with Avro, Protobuf, and JSON Schema, including Schema Registry integration and subject name strategies. - **Early–Middle (~23%–39%)**: Covers schema references for handling multiple event types per topic, then dives deep into Kafka clients: producer configurations, custom partitioners, consumer groups, offset committing, and the two-level heartbeat/session timeout system. - **Middle (~39%–48%)**: Explains consumer group mechanics in detail—group coordinators, eager vs. cooperative rebalancing, and the stop-the-world cost of rebalances—then introduces exactly-once delivery semantics with idempotent and transactional producers. - **Late (~48%–end)**: Moves into Kafka Connect for integrating external systems, including Single Message Transforms, sink connectors, and building custom connectors—the bridge between Kafka and the rest of your architecture. ## 【Key Takeaways】 - **Events are business-critical data, not transient messages** (Early): Kafka's value proposition is preserving events for replay and audit, not just passing messages between services—this mindset shapes all downstream design decisions. - **Schema management is non-negotiable** (Early): Avro, Protobuf, and JSON Schema each have trade-offs; Avro uses JSON definitions with defaults, Protobuf relies on field numbers and type-based defaults, and JSON Schema is most readable—pick based on your ecosystem. - **Subject name strategies control schema evolution** (Early): TopicNameStrategy, RecordNameStrategy, and TopicRecordNameStrategy each balance flexibility for multiple types per topic against version control—choose deliberately based on whether you need multiple event types or cross-topic versioning. - **Schema references constrain multi-type topics** (Early): Using Avro unions with schema references lets you have multiple event types per topic while limiting them to a defined set—critical for maintaining order and sequence of related events. - **Custom partitioners give fine-grained control** (Middle): When default partitioning doesn't fit your data patterns (e.g., routing special orders to a single partition), implementing a custom partitioner is straightforward and powerful. - **Consumer group coordination has real costs** (Middle): Rebalances are "stop-the-world" operations; cooperative rebalancing (Kafka 2.4+) reduces downtime, but you must understand group coordinator mechanics to design resilient consumers. - **Exactly-once delivery requires transactional coordination** (Middle): The producer epoch mechanism prevents zombie producers from corrupting transactions—if a producer is fenced, you must close and restart it, making failure handling a design consideration. ## 【Reading Tips】 - **Skim the broker internals** (~10%–19%): You need the mental model, not the implementation details—focus on produce/consume request flow and replication basics, then move on. - **Deep-read the schema chapters** (~19%–39%): Schema design and Schema Registry configuration are where real-world Kafka projects succeed or fail; pay special attention to the subject name strategy comparison table and schema reference examples. - **Study the consumer group section carefully** (~39%–48%): The group coordinator, rebalance protocols, and offset committing are the most conceptually dense material—work through the figures and examples slowly. - **Use the code samples as your primary learning tool**: The book references specific classes (e.g., `BaseProducer`, `TransactionalProducerConsumerTest`) in the accompanying source—clone the repo and run the tests to solidify understanding. - **Skip the acknowledgments and foreword** (~0%–3%): They add context but no technical content; jump straight to Chapter 1. ## 【Coverage Limits】 This guide covers the first half of the book (through Kafka Connect introduction). The excerpts do not cover Kafka Streams DSL specifics, state stores, KTables, or the stream processing portions promised by the title—those appear in later chapters not included in this sample. ##
Page 18
orward, just making adjustments for things like API changes. But in this case, I wanted to expand on my previous work and decided to do an entire rewrite. Be...
View in text
Excerpt 2
This means there is much less data that needs to get moved around, so changing the number of brokers will be much faster. As of the writing of this book (Oct...
View in text
Excerpt 3
opics TopicNameStrategy Maybe Yes RecordNameStrategy Yes No TopicRecordNameStrategy Yes Yes 3.6 Schema references and multiple events per topic 79constrained...
View in text
Excerpt 4
ng your code waits for the completion of processing of each record. However, suppose you were to hand off records to another thread for asyn- chronous proces...
View in text
Excerpt 5
"value.converter.schemas.enable": "false", "tasks.max":"1" Disables the schema }' Sets the maximum for the records number of tasks for the connector So, this...
View in text
Excerpt 6
ing listing contains the code for KeyValueMapper. Listing 6.10 KeyValueMapper returning a collection of PurchasedItem objects Extracts the zip code on the pu...
View in text
Excerpt 7
RetailPurchase, produces the joined result object Promotion> purchaseJoiner = new PromotionJoiner(); JoinWindows thirtyMinuteWindow = JoinWindows.ofTimeDiffe...
View in text
Excerpt 8
LogConfigs = new HashMap<>(); changeLogConfigs.put("cleanup.policy", "compact,delete"); builder.stream("input") Uses the .groupByKey() withLoggingEnabled .co...
View in text
Tags
AI categories
BackendProgrammingCloud Native
Publish Year: 2024
Language: English
File Format: PDF
File Size: 16.1 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…