Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Apache Kafka 1.0 Cookbook
Apache Kafka 1.0 Cookbook

Apache Kafka 1.0 Cookbook: Over 100 practical recipes on using distributed enterprise messaging to handle real-time data

eBook
€8.99 €23.99
Paperback
€29.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Apache Kafka 1.0 Cookbook

Kafka Clusters

In this chapter, we will cover the following topics:

  • Configuring a single-node single-broker cluster – SNSB
  • SNSB – creating a topic, producer, and consumer
  • Configuring a single-node multiple-broker cluster – SNMB
  • SNMB – creating a topic, producer, and consumer
  • Configuring a multiple-node multiple-broker cluster – MNMB

Introduction

In the previous chapter, we explained how to program with the Apache Kafka publisher-subscriber messaging system. In Apache Kafka there are three types of clusters:

  • Single-node single-broker
  • Single-node multiple-broker
  • Multiple-node multiple-broker cluster

The following four recipes show how to run Apache Kafka in these clusters.

Configuring a single-node single-broker cluster – SNSB

The first cluster configuration is single-node single-broker (SNSB). This cluster is very useful when a single point of entry is needed. Yes, its architecture resembles the singleton design pattern. A SNSB cluster usually satisfies three requirements:

  • Controls concurrent access to a unique shared broker
  • Access to the broker is requested from multiple, disparate producers
  • There can be only one broker

If the proposed design has only one or two of these requirements, a redesign is almost always the correct option.

Sometimes, the single broker could become a bottleneck or a single point of failure. But it is useful when a single point of communication is needed.

Getting ready

...

SNSB – creating a topic, producer, and consumer

The SNSB Kafka cluster is running; now let's create topics, producer, and consumer.

Getting ready

We need the previous recipe executed:

  • Kafka already installed
  • ZooKeeper up and running
  • A Kafka server up and running
  • Now, go to the Kafka installation directory (/usr/local/kafka/ for macOS users and /opt/kafka/ for Linux users):
    > cd /usr/local/kafka  

How to do it...

The following steps will show you how to create an SNSB topic, producer, and consumer.

...

Configuring a single-node multiple-broker cluster – SNMB

The second cluster configuration is single-node multiple-broker (SNMB). This cluster is used when there is just one node but inner redundancy is needed.

When a topic is created in Kafka, the system determines how each replica of a partition is mapped to each broker. In general, Kafka tries to spread the replicas across all available brokers.

The messages are first sent to the first replica of a partition (to the current broker leader of that partition) before they are replicated to the remaining brokers.

The producers may choose from different strategies for sending messages (synchronous or asynchronous mode). Producers discover the available brokers in a cluster and the partitions on each (all this by registering watchers in ZooKeeper).

In practice, some of the high volume topics are configured with more than one...

SNMB – creating a topic, producer, and consumer

The SNMB Kafka cluster is running; now let's create topics, producer, and consumer.

Getting ready

We need the previous recipe executed:

  • Kafka already installed
  • ZooKeeper up and running
  • A Kafka server up and running
  • Now, go to the Kafka installation directory (/usr/local/kafka/ for macOS users and /opt/kafka/ for Linux users):
    > cd /usr/local/kafka  

How to do it...

The following steps will show you how to create an SNMB topic, producer, and consumer

...

Configuring a multiple-node multiple-broker cluster – MNMB

Finally, the third cluster configuration is multiple-node multiple-broker (MNMB). This cluster is used when there are several nodes and one or many brokers per node.

Getting ready

Go to the Kafka installation directory (/usr/local/kafka/ for macOS users and /opt/kafka/ for Linux users):

> cd /usr/local/kafka  

How to do it...

The following diagram shows an example MNMB cluster:

Here we are presented with the real power of the cluster. In this cluster, Kafka should be installed on every machine in...

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • • Use Kafka 1.0 features such as Confluent platforms and Kafka streams to build efficient streaming data applications to handle and process your data
  • • Integrate Kafka with other Big Data tools such as Apache Hadoop, Apache Spark, and more
  • • Hands-on recipes to help you design, operate, maintain, and secure your Apache Kafka cluster with ease

Description

Apache Kafka provides a unified, high-throughput, low-latency platform to handle real-time data feeds. This book will show you how to use Kafka efficiently, and contains practical solutions to the common problems that developers and administrators usually face while working with it. This practical guide contains easy-to-follow recipes to help you set up, configure, and use Apache Kafka in the best possible manner. You will use Apache Kafka Consumers and Producers to build effective real-time streaming applications. The book covers the recently released Kafka version 1.0, the Confluent Platform and Kafka Streams. The programming aspect covered in the book will teach you how to perform important tasks such as message validation, enrichment and composition.Recipes focusing on optimizing the performance of your Kafka cluster, and integrate Kafka with a variety of third-party tools such as Apache Hadoop, Apache Spark, and Elasticsearch will help ease your day to day collaboration with Kafka greatly. Finally, we cover tasks related to monitoring and securing your Apache Kafka cluster using tools such as Ganglia and Graphite. If you're looking to become the go-to person in your organization when it comes to working with Apache Kafka, this book is the only resource you need to have.

Who is this book for?

This book is for developers and Kafka administrators who are looking for quick, practical solutions to problems encountered while operating, managing or monitoring Apache Kafka. If you are a developer, some knowledge of Scala or Java will help, while for administrators, some working knowledge of Kafka will be useful.

What you will learn

  • -Install and configure Apache Kafka 1.0 to get optimal performance
  • -Create and configure Kafka Producers and Consumers
  • -Operate your Kafka clusters efficiently by implementing the mirroring technique
  • -Work with the new Confluent platform and Kafka streams, and achieve high availability with Kafka
  • -Monitor Kafka using tools such as Graphite and Ganglia
  • -Integrate Kafka with third-party tools such as Elasticsearch, Logstash, Apache Hadoop, Apache Spark, and more

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Dec 22, 2017
Length: 250 pages
Edition : 1st
Language : English
ISBN-13 : 9781787282186
Vendor :
Apache
Category :
Languages :
Concepts :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Dec 22, 2017
Length: 250 pages
Edition : 1st
Language : English
ISBN-13 : 9781787282186
Vendor :
Apache
Category :
Languages :
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 96.97
Building Data Streaming Applications with Apache Kafka
€36.99
Learning Elastic Stack 6.0
€29.99
Apache Kafka 1.0 Cookbook
€29.99
Total 96.97 Stars icon
Banner background image

Table of Contents

10 Chapters
Configuring Kafka Chevron down icon Chevron up icon
Kafka Clusters Chevron down icon Chevron up icon
Message Validation Chevron down icon Chevron up icon
Message Enrichment Chevron down icon Chevron up icon
The Confluent Platform Chevron down icon Chevron up icon
Kafka Streams Chevron down icon Chevron up icon
Managing Kafka Chevron down icon Chevron up icon
Operating Kafka Chevron down icon Chevron up icon
Monitoring and Security Chevron down icon Chevron up icon
Third-Party Tool Integration Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
(2 Ratings)
5 star 0%
4 star 50%
3 star 0%
2 star 50%
1 star 0%
Miguel Angel Enriquez Lopez Feb 16, 2018
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Recently at work, we had to start using Kafka for processing events from different sources. As a DevOps engineer, I had to set up many environments with Kafka topics available for the applications we are using. I can say that I got this book and I have been checking it almost daily for a quick reference to do my work and it has proven to be very useful to get started quickly and then come back for more advanced topics.Surprisingly this book covers many recipes that I had to copy almost verbatim which is a proof of the quality of the book in the sense that the recipes "just work."Nonetheless, while I with mostly with Docker containers or Hashicorp Packer to create templates of servers, some parts of the book require executing "manual" steps such as go to a particular URL and download the Kafka/Scala binaries. While I understand that it is easier just to write the step as "Go to this URL and get the latest version of X", some steps could have been written better with commands to get the binary from the command line instead of that. Nevertheless, this is not a concern given the overall excellence of the book.
Amazon Verified review Amazon
Gourav Jul 15, 2022
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
the content given in the book is very little , it doesnt describe the Kafka in detail , why that feature is used for specific program or what program is doing.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.