Skip to content

companieshouse/chs-notification-kafka-consumer

Repository files navigation

chs-notification-kafka-consumer

flowchart LR
    ExternalApp["External CHS App"] -->|REST| Module1
    Module1["sender-api"] -->|Kafka| Module2
    Module2["📌 kafka-consumer"] -->|REST| Module3
    Module3["govuk-notify-api"] -->|REST| GovUKNotify
    GovUKNotify["GovUK Notify"]
    
    subgraph PoseidonSystem["🔱 chs-notification"]
        Module1
        Module2
        Module3
    end
    
    %% Styling for all elements - light/dark mode compatible
    classDef normal fill:#f8f8f8,stroke:#666666,stroke-width:1px,color:#333333,rx:4,ry:4
    classDef current fill:#0099cc,stroke:#007799,stroke-width:2px,color:white,rx:4,ry:4
    classDef external fill:#e6e6e6,stroke:#999999,stroke-width:1px,color:#333333,rx:4,ry:4
    classDef system fill:transparent,stroke:#0077b6,stroke-width:1.5px,stroke-dasharray:3 3,color:#00a8e8,rx:10,ry:10
    
    class Module1 normal;
    class Module2 current;
    class Module3 normal;
    class ExternalApp external;
    class GovUKNotify external;
    class PoseidonSystem system;
    %% Adding clickable links to GitHub repos
    click Module1 "https://github.com/companieshouse/chs-notification-sender-api" _blank
    click Module3 "https://github.com/companieshouse/chs-gov-uk-notify-integration-api" _blank
Loading

Overview

This service:

  • Consumes notification messages from Kafka topics
  • Forwards messages to chs-gov-uk-notify-integration-api (Module 3) via REST
  • Is Module 2 of 3 in the chs-notification system

Related Services

API Integration

Sends email and letter requests to chs-gov-uk-notify-integration-api (Module 3).

Endpoints

The service exposes the following endpoints:

  • Service health: GET /notification-consumer/healthcheck

Prerequisites

  • Java 21
  • Maven

Running Locally

Prerequisites

Start a Kafka broker to allow messages to be consumed:

docker compose up KafkaBroker

Running the Application

Option 1: Using IntelliJ IDEA

  1. Open the project in IntelliJ
  2. Set Project SDK to Java 21
  3. Locate the main application class: ChsNotificationKafkaConsumerApplication.java
  4. Right-click and select "Run" or "Debug"

Option 2: Using Maven CLI

mvn spring-boot:run

Repository Structure

chs-notification-kafka-consumer/
│── src/                    
│   ├── main/               # Main application code
│   └── test/               # Test code
│── pom.xml                 # Dependencies
│── ecs-image-build/        # ECS Dockerfile
│── terraform/              # Infrastructure code
│── ...                     # Other files/folders
└── README.md               # This file

About

Consume kafka message and send a request to send a letter or email

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 13