Skip to content

Latest commit

 

History

History
117 lines (102 loc) · 6 KB

File metadata and controls

117 lines (102 loc) · 6 KB

monitor-notification-matcher

Part of Monitor/Follow system. Identifies which users want to be notified of filings taken place for a particular company.

Service Overview

  • Consume message from notification-match Kafka Topic.
  • Extract the company number, optionally contained within the message.
  • Lookup the company details using the company number: http://api.chs.local:4001/company/00640000/company-detail
  • Scan the filing (provided within the message payload) for the relevant email data.
  • Create an email match with the correct filing data, ready for submission.
  • Store the email match in the matches collection within the monitor Mongo DB.
  • Serialize the email match and publish the message onto the message-send topic (to send email).
  • Log the output data to the relevant topics and collections at TRACE level for support.

Incoming Messages (Consumed)

  • Incoming messages are consumed from a Kafka Topic named: notification-match
    • Headers:
      • correlation_id: (Taken and inserted from the consumed message)
      • reply_to: Kafka topic name to send response to
    • Body:
      {
          "data": {
              "app_id": "monitor-notification-matcher.filing",
              "company_number": "00006400",
              "data": {
                  "type": "AP01",
                  "description" : "appoint-person-director-company-with-name-date",
                  "description_values" : {
                      "appointment_date" : "1 December 2024",
                      "officer_name" : "DR AMIDAT DUPE IYIOLA"
                  },
                  "links" : {
                      "self" : "/transactions/158153-915517-386847/officers/67a2396e8e70c90c76a3ba62"
                  },
                  "category": "officers",
                  "paper_filed": false,
                  "subcategory": "appointments",
                  "action_date": "2025-02-04",
                  "date": "2025-02-04"
              },
              "is_delete": false
          },
          "kind": "email",
          "notified_at": "2025-03-03T15:04:03",
          "user_id": "1vKD26OwehmZI6MpGz9D02-dmCI"
      }

Outgoing Messages (Produced)

  • Outgoing messages are produced to a Kafka Topic named: message-send
    • Headers:
      • correlation_id: (Taken and inserted from the consumed message)
      • reply_to: Kafka topic name to send response to
    • Body:
      No longer used - see CHS Kafka API section below.
      

Outgoing Messages (CHS Kafka API)

  • Outgoing messages are POSTED to the CHS Kafka API endpoint named: /message-send
    • Headers:
      • correlation_id: (Taken and inserted from the consumed message)
      • reply_to: Kafka topic name to send response to
      • Body:
      {
            "app_id": "monitor-notification-matcher.filing",
            "message_id": "msg-001",
            "message_type": "monitor_email",
            "data": {
                "CompanyName": "My Own Company",
                "CompanyNumber": "00006400",
                "FilingDate": "24 Feb 2025",
                "FilingDescription": "TEST FILING EMAIL",
                "FilingType": "AD01",
                "IsDelete": false,
                "MonitorURL": "https://follow.cidev.aws.chdev.org",
                "from": "test@companieshouse.gov.uk",
                "subject": "TEST"
            },
            "created_at": "2025-02-20T17:00:00Z",
            "user_id": "1vKD26OwehmZI6MpGz9D02-dmCI"
      }

Sonar Analysis

The code is regularly run through the quality gate, which can be found here: Sonar Analysis

Terraform ECS

What does this code do?

The code present in this repository is used to define and deploy a dockerised container in AWS ECS. This is done by calling a module from terraform-modules. Application specific attributes are injected and the service is then deployed using Terraform via the CICD platform 'Concourse'.

Application specific attributes Value Description
ECS Cluster follow ECS cluster (stack) the service belongs to
Load balancer N/A
consumer
The load balancer that sits in front of the service
Concourse pipeline Pipeline link
Pipeline code
Concourse pipeline link in shared services

Contributing

Testing

  • Ensure the terraform runner local plan executes without issues. For information on terraform runners please see the Terraform Runner Quickstart guide.
  • If you encounter any issues or have questions, reach out to the team on the #platform slack channel.

Vault Configuration Updates

  • Any secrets required for this service will be stored in Vault. For any updates to the Vault configuration, please consult with the #platform team and submit a workflow request.

Useful Links