java-messaging

Provide Java messaging patterns for RabbitMQ, Kafka, JMS, and Redis Streams.

11|1|Updated Feb 9, 2026
One-click install
npx skills add https://github.com/mindcockpit-ai/cognitive-core --skill java-messaging
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: java-messaging
Source: https://github.com/mindcockpit-ai/cognitive-core/tree/main/language-packs/java/skills/java-messaging
Command: npx skills add https://github.com/mindcockpit-ai/cognitive-core --skill java-messaging

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides clear, graduated messaging and middleware patterns so teams can choose the right Java eventing approach for their scale and reliability needs, avoiding premature complexity or lost messages.

Core Features & Use Cases

  • Graduated patterns: In-process events, Spring Events, Spring AMQP (RabbitMQ), JMS/ActiveMQ, Apache Kafka, and Redis Streams with guidance on when to adopt each.
  • Production concerns: Configuration examples for exchanges, queues, consumer groups, retries, manual acks, dead-lettering, and concurrency tuning.
  • Testing & migration: Testcontainers and embedded broker strategies, anti-patterns to avoid, and a phased migration path from single-JVM to enterprise streaming.

Quick Start

Recommend the appropriate Java messaging pattern for a service that requires durable cross-service delivery, ordering per entity, and replayability for auditing.

Frequently Asked Questions about java-messaging

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

FAQPage Schema
When should I use Kafka over RabbitMQ or Spring Events for Java messaging?

Use Kafka for distributed microservices requiring durable delivery, replayability, and high throughput. Use RabbitMQ for complex routing and work queues, Spring Events for single-JVM decoupling, and Redis Streams for lightweight consumer groups.

How do I configure dead-lettering and retries for RabbitMQ consumers in Spring?

Configure Spring AMQP exchanges and queues with dead-letter bindings, set retry policies with exponential backoff, and use manual acks to control redelivery. This ensures failed messages are safely isolated instead of blocking consumer concurrency.

What is the best way to test Java messaging applications with Kafka or RabbitMQ?

Use Testcontainers to spin up embedded Kafka or RabbitMQ brokers during testing. This validates consumer groups, transactional event handling, and delivery reliability without needing a persistent external messaging infrastructure.

Does Spring support transactional event handling for domain events across microservices?

Yes, Spring supports transactional event handling to reliably publish domain events. For cross-service delivery, combine transactional outbox patterns with Kafka or JMS/ActiveMQ to prevent message loss during database commit failures.

How do I migrate Java messaging from single-JVM events to enterprise streaming?

Follow a phased migration path: start with in-process Spring Events, progress to Spring AMQP or JMS for cross-service work queues, then adopt Apache Kafka or Redis Streams when you need durable replayability and consumer groups.

Why does ordering per entity fail in Kafka consumer groups, and how do I fix it?

Ordering fails when partitioning keys are inconsistent. Fix Kafka consumer group ordering by mapping entity IDs to specific partition keys, ensuring all events for a single entity route to the same consumer sequentially.