Skip to main content

On This Page

Introduction to Hermes Message Broker

2 min read
Share

These articles are AI-generated summaries. Please check the original sources for full details.

Introduction to Hermes Message Broker

Hermes, a Kafka-based message broker, simplifies messaging with HTTP APIs and minimal infrastructure dependencies. It runs on Docker with a 2.11.7 version as of 2025-11-29.

Why This Matters

Traditional message brokers often require complex configurations and deep knowledge of underlying systems. Hermes abstracts Kafka’s complexity, offering HTTP-centric APIs that reduce setup overhead while maintaining Kafka’s reliability and scalability. However, reliance on HTTP introduces latency compared to native Kafka clients, and misconfigured subscriptions can lead to message loss if endpoints fail to respond with 2xx status codes.

Key Insights

  • “Hermes 2.11.7 version, 2025”: Latest stable release at time of writing.
  • “HTTP-centric design for cross-tech app integration”: Enables any client to publish/subscribe without Kafka-specific code.
  • “Docker Compose setup for Kafka, Zookeeper, Hermes components”: Simplifies local testing with preconfigured containers.

Working Example

services:
  zk:
    image: "confluentinc/cp-zookeeper:7.9.4"
    ports:
      - "2181:2181"
    environment:
      ZOOKEEPER_CLIENT_PORT: 2181
  kafka:
    image: "confluentinc/cp-kafka:7.9.4"
    ports:
      - '9092:9092'
    depends_on:
      - zk
    environment:
      KAFKA_ZOOKEEPER_CONNECT: zk:2181
      KAFKA_ADVERTISED_LISTENERS: DOCKER_INTERNAL_LISTENER://kafka:29092,DOCKER_EXTERNAL_LISTENER://localhost:9092
  frontend:
    image: allegro/hermes-frontend:hermes-2.11.7
    ports:
      - "8080:8080"
    depends_on:
      - zk
      - kafka
HermesClient hermesClient = HermesClientBuilder.hermesClient(new WebClientHermesSender(WebClient.create()))
    .withURI(URI.create("http://localhost:8080"))
    .build();

CompletableFuture<HermesResponse> result = hermesClient.publishJSON("com.baeldung.hermes.testing", "{\"hello\": 1}");

Practical Applications

  • Use Case: Microservices communication via HTTP endpoints with guaranteed message delivery.
  • Pitfall: Failing to handle 5xx errors in subscriber endpoints may result in undelivered messages and retries.

References:


Continue reading

Next article

Vue 3.5 Introduces defineModel and useTemplateRefs for Streamlined Development

Related Content