Notifications sms
API
Public API
- DeliveryReportController Endpoint receiving delivery reports in XML-format from SMS provider. The controller is protected with basic authentication.
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:
- SendSmsQueueConsumer: Consumes sms objects with recipient data that are ready to be sent
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
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
Service | Purpose | Resources |
---|---|---|
Apache Kafka on Confluent Cloud | Hosts the Kafka broker | Documentation |
Link Mobility | Sends out sms to recipients and reports back | Documentation |
Azure Monitor | Telemetry from the application is sent to Application Insights | Documentation |
Azure Key Vault | Safeguards secrets used by the microservice | Documentation |
Azure Kubernetes Services (AKS) | Hosts the microservice and cron jobs | Documentation |
Altinn Services
Service | Purpose | Resources |
---|---|---|
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.
Library | Purpose | Resources |
---|---|---|
Link Mobility | Interact with Link Mobility XML Gateway | Repository, Documentation |
Confluent.Kafka | Integrate with kafka broker | Repository, 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
- Build and Code analysis runs in a Github workflow
- Build of the image is done in an Azure Devops Pipeline
- Deploy of the image is enabled with Helm and implemented in an Azure Devops Release pipeline
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.