Kafka Consumer
Message Consumption
Existing Topic
Debugging Kafka
Troubleshooting

Kafka consumer doesn't consume messages from an existing topic

Codemia Knowledge Hub ·

When a Kafka consumer reads nothing from a topic that exists, the cause is usually configuration: the wrong consumer group, a mistyped topic name, offsets that are out of range, an improper auto.offset.reset, or misconfigured deserializers. Network problems and broker permissions are the other common causes. Check them in the order below.

Why consumers fail to consume

1. Consumer group misconfiguration

The consumer may be in the wrong consumer group or in no group at all. Kafka consumers use a group to coordinate and distribute partitions, so consumers that unintentionally end up in different groups do not share the work of reading a topic.

2. The topic or partition does not exist

A misconfiguration or a typo in the topic name can point the consumer at a topic or partition that does not exist. The consumer then waits indefinitely for messages.

3. Offsets out of range

The consumer's offsets may be out of range when:

  • the offsets were altered manually, or
  • messages were deleted by Kafka's retention policy, so the consumer asks for an offset that no longer exists.

4. Network problems

Network problems between the broker and the consumer, such as DNS resolution issues, firewall rules or network partitions, can stop messages from arriving.

5. Broker settings

If the broker configuration denies the consumer the permissions it needs, or uses incompatible settings, the consumer may be unable to read the topic.

6. Consumer configuration

An improperly set auto.offset.reset or misconfigured message deserializers can also keep the consumer from consuming messages properly.

Troubleshooting steps

  1. Validate the topic: make sure the topic exists and the consumer uses the correct topic name.
  2. Check the consumer group: verify that all intended consumers are in the same consumer group.
  3. Read consumer and broker logs: they show misconfigurations, errors and network issues.
  4. Inspect the consumer configuration: double-check bootstrap.servers, group.id, auto.offset.reset and the deserializer settings.
  5. Run network diagnostics: check connectivity between the consumer and the brokers.
  6. Check partition assignment: confirm the consumer is assigned partitions. If automatic partition assignment (partition.assignment.strategy) is misconfigured, a consumer might not receive messages.

Consumer metrics to monitor

These metrics help you spot problems early:

  • Consumer lag: the offset difference between the last produced message and the last consumed message.
  • Fetch rate: how fast the consumer fetches records.
  • Throughput: the number of messages processed in a given timeframe.

Checks at a glance

IssueKey CheckSolution Suggestion
Misconfigured Groupgroup.id in consumer configEnsure all related consumers share the same group.id
Non-existent Topic/PartitionVerify topic and partition existenceCorrect any typos or misconfigurations in topic names
Offset Out of RangeConsumer offset statusReset the consumer offset to earliest or latest
Network IssuesNetwork connectivity diagnosticsCheck firewalls, DNS, and other network settings
Broker SettingsBroker permissions and configurationsAdjust configurations or permissions as necessary
Incorrect Configurationauto.offset.reset, DeserializersReview and correct consumer configuration settings

Course
Beginner
27 lessons
10 hours
System Design Fundamentals

Build a strong foundation in designing scalable, reliable distributed systems.

View the course
System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design