Last modified: Jun 5, 2024

Notifications sms

API

Public API

Integrations

Kafka

The Notifications sms microservice has an integration towards a Kafka broker, and this integration is used both to publish and consume messages from topics relevant to the microservice.

Consumers: The following Kafka consumers are defined:

Producers: A single producer KafkaProducer is implemented and used by all services that publish to Kafka.

Please reference the Kafka architecture section for a closer description of the Kafka setup.

Link Mobility is used as service provider for sending sms to the end users. A client, SmsClient has been implemented based on the SDK made available by Link to interact with their API.

Delivery reports from Link Mobility are pushed to the delivery report endpoint in our public API.

Altinn SMS integrates with Link Mobility through an SMS Gateway using their XML API. AT, YT and TT environments use the publicly available test gateway, and production uses a Digdir dedicated SMS gateway.

API documentation for the Gateway is available on Link’s website.

Dependencies

The microservice takes use of a range of external and Altinn services as well as .NET libraries to support the provided functionality. Find descriptions of key dependencies below.

External Services

ServicePurposeResources
Apache Kafka on Confluent CloudHosts the Kafka brokerDocumentation
Link MobilitySends out sms to recipients and reports backDocumentation
Azure MonitorTelemetry from the application is sent to Application InsightsDocumentation
Azure Key VaultSafeguards secrets used by the microserviceDocumentation
Azure Kubernetes Services (AKS)Hosts the microservice and cron jobsDocumentation

Altinn Services

ServicePurposeResources
Altinn Notifications*Service that orchestrates the sending of notifications.Repository

*Functional dependency to enable the full functionality of Altinn Notifications. Altinn Notifications generates the sms messages that are to be sent through this sms service.

.NET Libraries

Notifications microservice takes use of a range of libraries to support the provided functionality.

LibraryPurposeResources
Link MobilityInteract with Link Mobility XML GatewayRepository, Documentation
Confluent.KafkaIntegrate with kafka brokerRepository, Documentation

Testing

Quality gates implemented for a project require an 80 % code coverage for the unit and integration tests combined. xUnit is the framework used and the Moq library supports mocking parts of the solution.

Unit tests

The unit test project is available on GitHub.

Integration tests

The integration test project is available on GitHub.

There is a single dependency for the integration tests. Remaining dependencies such as Link Mobility have been mocked.

  • Kafka server.

    A YAML file has been created to easily start all Kafka-related dependencies in a Docker containers.

Automated tests

No automated tests are set up for this component as it is considered that the integrations and availability are implicitly tested through automated tests on the orchestrating service, Altinn Notifications.

Use case tests

No use case tests are set up for this component as it is considered that the integrations and availability are implicitly tested through use case tests on the orchestrating service, Altinn Notifications.

Hosting

Web API

The microservice runs in a Docker container hosted in AKS, and it is deployed as a Kubernetes deployment with autoscaling capabilities.

The notifications sms application runs on port 5092.

See DockerFile for details.

Build & deploy

Web API

Run on local machine

Instructions on how to set up the service on local machine for development or testing is covered by the README in the repository.