Advanced Spring Boot 4: Event-Driven Architecture (Kafka) · 강의

소비자 그룹과 재조정

Kafka 소비자 그룹이 소비를 확장하는 방식과 파티션 할당 방식, 재조정 중에 발생하는 일을 Spring Kafka를 기준으로 이해하세요.

레슨 4/413개 단계

소비자 그룹과 재조정은(는) CoddyKit의 무료 Advanced Spring Boot 4: Event-Driven Architecture (Kafka) 강의입니다. 이것은 4개 중 4번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 Advanced Spring Boot 4: Event-Driven Architecture (Kafka) 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. Advanced Spring Boot 4: Event-Driven Architecture (Kafka) 강의에는 총 4개의 강의가 포함되어 있습니다.

이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.

Why Consumer Groups?

A consumer group lets multiple consumer instances share the work of reading a topic. Kafka assigns each partition to exactly one consumer in the group.

Group ID

Consumers join a group by sharing a group.id. Kafka tracks the offset position per group, so each group reads the topic independently.

spring.kafka.consumer.group-id=order-service

Partitions Drive Parallelism

The number of partitions sets the maximum parallelism. With four partitions, at most four consumers in a group can work at once.

topic orders: 4 partitions
group with 4 consumers -> 1 partition each

Extra Consumers Idle

If a group has more consumers than partitions, the extras sit idle. Scale partitions to scale consumption beyond the current limit.

6 consumers, 4 partitions -> 2 idle

What Triggers a Rebalance

A rebalance reassigns partitions when group membership changes.

  • A consumer joins or leaves
  • A consumer is considered dead
  • Partitions are added

Rebalance Cost

During a rebalance, consumers stop processing briefly while partitions are reassigned. Frequent rebalances hurt throughput.

Heartbeats and Liveness

Consumers send heartbeats. Missing them past session.timeout.ms marks a consumer dead and triggers a rebalance.

session.timeout.ms = 10000
heartbeat.interval.ms = 3000

Poll Loop Health

If processing between polls exceeds max.poll.interval.ms, the consumer is evicted. Keep per-message work bounded or increase the limit.

max.poll.interval.ms = 300000

Committing Offsets

Offsets record progress per partition per group. Spring Kafka can auto-commit or commit manually after successful processing for at-least-once delivery.

spring.kafka.consumer.enable-auto-commit=false

Cooperative Rebalancing

The cooperative rebalance protocol reassigns only the partitions that must move, avoiding a full stop-the-world reassignment.

partition.assignment.strategy=CooperativeStickyAssignor

Spring Kafka Listeners

A @KafkaListener joins the configured group automatically; running multiple app instances scales the group with no code change.

@KafkaListener(topics = "orders", groupId = "order-service")
void onOrder(Order o) { ... }

Quick Check

Reason about parallelism.

Recap

You learned that a consumer group shares a topic by assigning each partition to one consumer, so partition count caps parallelism. Rebalances reassign partitions when membership changes and briefly pause processing; heartbeats and poll intervals govern liveness. Cooperative rebalancing and manual offset commits keep Spring Kafka consumers efficient and reliable.

무료로 시작

AI 튜터와 함께 Advanced Spring Boot 4: Event-Driven Architecture (Kafka)을(를) 배우세요 — 무료

브라우저에서 실제 코드를 작성하고 실행하며, 24/7 AI 튜터로부터 즉각적인 도움을 받고, 웹이나 앱에서 중단한 부분부터 계속 학습하세요.

코스
12
레슨
48

자주 묻는 질문

“소비자 그룹과 재조정” 강의는 무료인가요?

네 — “소비자 그룹과 재조정” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 Advanced Spring Boot 4: Event-Driven Architecture (Kafka) 강의 전체를 잠금 해제할 수 있습니다. Advanced Spring Boot 4: Event-Driven Architecture (Kafka) 강의에는 총 4개의 강의가 포함되어 있습니다.

“소비자 그룹과 재조정”에서 뭘 배우나요?

Kafka 소비자 그룹이 소비를 확장하는 방식과 파티션 할당 방식, 재조정 중에 발생하는 일을 Spring Kafka를 기준으로 이해하세요. 브라우저에서 직접 실행하는 실습 코드로 Advanced Spring Boot 4: Event-Driven Architecture (Kafka)을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.

Advanced Spring Boot 4: Event-Driven Architecture (Kafka)을(를) 시작하는 데 경험이 필요한가요?

사전 경험은 필요하지 않습니다. CoddyKit의 Advanced Spring Boot 4: Event-Driven Architecture (Kafka)은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 4번째 강의입니다.

“소비자 그룹과 재조정” 강의는 얼마나 걸리나요?

대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.

이 Advanced Spring Boot 4: Event-Driven Architecture (Kafka) 강의에서 코드를 작성하고 실행할 수 있나요?

네. 모든 Advanced Spring Boot 4: Event-Driven Architecture (Kafka) 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.

이 강의의 모든 강의

  1. Kafka 아키텍처 개요
  2. 토픽, 파티션, 오프셋
  3. Docker로 로컬 Kafka 설정
  4. 소비자 그룹과 재조정
← Advanced Spring Boot 4: Event-Driven Architecture (Kafka)(으)로 돌아가기