kafka

Designs Rap-and-Rivers Kafka integrations for Kotlin/Nais services with TestRapid validation.

52|13|Updated Jan 10, 2025
One-click install
npx skills add https://github.com/navikt/copilot --skill kafka-navikt
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: kafka
Source: https://github.com/navikt/copilot/tree/main/.github/skills/kafka
Command: npx skills add https://github.com/navikt/copilot --skill kafka-navikt

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the challenge of designing and implementing reliable, event-driven Kafka integrations in Nav-style Kotlin services, including topic setup, event schema design, and safe consumer/producer patterns.

Core Features & Use Cases

  • Nais Kafka setup for applications: Configure Kafka connectivity through Nais manifest spec.kafka so credentials and environment variables are mounted automatically.
  • Rapids & Rivers consumer (River) patterns: Build River listeners with preconditions for event type filtering, validations for schema correctness, and clean error handling.
  • Event schema design and governance: Define event naming conventions, include required metadata (event name, id, created_at, produced_by, optional correlation id), and apply versioning strategies.
  • Testing and troubleshooting for event systems: Validate behavior with TestRapid and diagnose issues like connectivity, consumer lag, and contract violations.

Quick Start

Use the kafka skill to set up Rapids & Rivers rivers in a Nais Kotlin service and generate/validate Kafka events using the required event metadata and schema rules.

Frequently Asked Questions about kafka

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure Kafka connectivity for a Nais application?▼

Kafka connectivity for a Nais application is configured through the Nais manifest using spec.kafka, which automatically mounts the necessary credentials and environment variables for your service.

How do I build an event-driven consumer using Rapids & Rivers?▼

Event-driven consumers are built using River listeners with preconditions for event type filtering, validations for schema correctness, and clean error handling to process Kafka events reliably.

What required metadata should a Kafka event schema include?▼

A Kafka event schema must include standard metadata like event name, @id for idempotency, created_at, produced_by, and optional correlation id to ensure proper event governance and versioning.

How do I test and troubleshoot Kafka event systems?▼

Kafka event systems are tested and troubleshot using TestRapid to validate behavior, allowing you to diagnose connectivity issues, consumer lag, and contract violations within event-driven services.

Does this event-driven Kafka approach work with Kotlin JVM services?▼

This event-driven Kafka approach applies to Nais-backed Kotlin/JVM services, providing topic configuration, River-based event handling, and event versioning for reliable stream processing.

What is the best way to handle errors in Rapids & Rivers consumers?▼

Error handling in Rapids & Rivers consumers involves applying River validate rules with appropriate error handling and DLQ/retry guidance to manage event processing failures safely.