Skill

implementing-kafka-consumers

Install
1
Install the plugin
$
npx claudepluginhub allousas/claude-code-plugins --plugin kotlin-building-blocks

Want just this skill?

Add to a custom plugin, then install with one command.

Description

Apply when creating, modifying, or reviewing any file that consumes from Kafka (classes annotated with @KafkaListener or with names containing in Consumer/Listener)

Tool Access

This skill uses the workspace's default tool permissions.

Supporting Assets
View in Repository
examples.md
Skill Content

Purpose

Message consumers listen to message queues (Kafka, RabbitMQ) and trigger application services. They translate external messages into application service calls.

Typical Flow

  1. Receive a message from Kafka topic
  2. Parse and validate incoming message
  3. Filter out messages that are not relevant for the current consumer
  4. Transform message into application service parameters (DTOs or primitives)
  5. Call application service to trigger business use case
  6. Log and publish metrics for observability
  7. On failure, log error and rethrow to let Kafka error handling mechanisms (retries, DLQ) work

Guidelines

DO:

  • Delegate to global configured mechanisms for retries and recovery
  • File naming: <Topic><StreamSystem>Consumer, e.g., OrdersKafkaConsumer
  • Declare message DTOs in the same file for cohesion
  • Could call repositories directly for idempotency checks
  • Could call repositories directly for data replication use cases

DON'T:

  • Include business logic - only message parsing, delegation, and error handling
  • Suppress exceptions silently - rethrow after logging to allow retry/DLQ mechanisms
  • Do not leak kafka specific dtos or classes to application services

Spring specifics

  • Use @KafkaListener annotation
  • Ensure @EnableKafka is enabled
  • Use KafkaConfig class for separate configuration
  • Ensure DefaultErrorHandler with exponential backoff is configured through ConcurrentKafkaListenerContainerFactory
  • Ensure DeadLetterPublishingRecoverer is configured

Examples

Please use always these examples as reference: examples.md

Stats
Stars1
Forks0
Last CommitFeb 25, 2026
Actions

Similar Skills

cache-components

Expert guidance for Next.js Cache Components and Partial Prerendering (PPR). **PROACTIVE ACTIVATION**: Use this skill automatically when working in Next.js projects that have `cacheComponents: true` in their next.config.ts/next.config.js. When this config is detected, proactively apply Cache Components patterns and best practices to all React Server Component implementations. **DETECTION**: At the start of a session in a Next.js project, check for `cacheComponents: true` in next.config. If enabled, this skill's patterns should guide all component authoring, data fetching, and caching decisions. **USE CASES**: Implementing 'use cache' directive, configuring cache lifetimes with cacheLife(), tagging cached data with cacheTag(), invalidating caches with updateTag()/revalidateTag(), optimizing static vs dynamic content boundaries, debugging cache issues, and reviewing Cache Component implementations.

138.4k