DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Java Consumer and Producer Messages Between Kafka Server [Video Tutorials]
  • Understanding Kafka and Event-Driven Architecture [Video Tutorials]
  • Apache Kafka in Java [Video Tutorials]: Architecture and Simple Consumer/Producer
  • Techniques You Should Know as a Kafka Streams Developer

Trending

  • The Permission Was Valid. The Action Was Not Authorized.
  • How to Migrate From LangChainGo to Genkit Go
  • Beyond the Endpoint: How Agent Cards Enable Discovery, Interoperability, and Trust
  • Java 27 Makes G1 the Default Everywhere: How to Test Your Small Containers Before You Upgrade

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  1. DZone
  2. Data Engineering
  3. Big Data
  4. Consumer Group in Kafka [Video Tutorials]: Partitions and Consumers

Consumer Group in Kafka [Video Tutorials]: Partitions and Consumers

In this video tutorial series, take a deeper look at the consumer group in Kafka with varying numbers of partitions and consumers.

By 
Ram N
·
Apr. 21, 23 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
6.3K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

In this video tutorial series, take a deeper look at the consumer group in Kafka with:

  • 1 partition and 2 consumers
  • 2 partitions and 2 consumers
  • 3 partitions and 1 consumer

Consumer Group in Kafka With 1 Partition and 2 Consumers

In this first Apache Kafka tutorial, learn about Java Kafka consumer code with 1 partition and 2 consumers.

  • Both consumers are registered to the same consumer group.
  • One consumer will be sitting idle.
  • The same partition cannot be assigned to multiple consumers in the same group.

Let's begin!


Consumer Group in Kafka With 2 Partitions and 2 Consumers

The following tutorial explains the Kafka consumer group with 2 partitions and 2 consumers.

  • Both consumers are registered to the same consumer group.
  • The same partition cannot be assigned to multiple consumers in the same group.


Consumer Group in Kafka with 3 Partitions and 1 Consumer

Now let's learn about 3 partitions and 1 consumer within consumer groups in Apache Kafka. 

  • The message will be published to partition randomly.
  • The message will be consumed by "consumer 1" in a round-robin.
  • One consumer can consume messages from more than one partition.


Java (programming language) kafka consumer Partition (database)

Opinions expressed by DZone contributors are their own.

Related

  • Java Consumer and Producer Messages Between Kafka Server [Video Tutorials]
  • Understanding Kafka and Event-Driven Architecture [Video Tutorials]
  • Apache Kafka in Java [Video Tutorials]: Architecture and Simple Consumer/Producer
  • Techniques You Should Know as a Kafka Streams Developer

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook