This service manages and sends notifications to trainees based on TIS Self-Service events.
gradlew bootRun- A Redis instance for caching Person ID to User ID mappings.
- A running instance of localstack or access to Amazon SQS, to retrieve
messages from the queue given as
COJ_PUBLISHED_QUEUE. COJ_PUBLISHED_QUEUEshould have a visibility timeout longer than the user cache takes to build, failure to do so may lead to duplicate emails being sent. See log messageTotal time taken to cache all user accounts was: <num>sfor time taken.- Access to an Amazon Cognito User Pool to get user details.
AWS credentials are retrieved using the DefaultCredentialsProvider, see the associated documentation for details of how to provide credentials.
The AWS region is retrieved using the DefaultAwsRegionProviderChain, see the associated document for details of how to provide the region.
| Name | Description | Default |
|---|---|---|
| ACCOUNT_CONFIRMED_QUEUE | The queue URL for account confirmation events. | |
| APP_DOMAIN | The domain to be used for links in email notifications. (Optional) | |
| AWS_XRAY_DAEMON_ADDRESS | The AWS XRay daemon host. (Optional) | |
| COGNITO_USER_POOL_ID | The user pool to get user details from. | |
| COJ_PUBLISHED_QUEUE | The queue URL for Conditions of Joining publish events. | |
| ENVIRONMENT | The environment to log events against. | local |
| EMAIL_SENDER | Where email notifications are to be sent from. | |
| NOTIFICATIONS_EVENT_TOPIC_ARN | Broadcast endpoint for notification events | |
| REDIS_HOST | Redis server host | localhost |
| REDIS_PASSWORD | Login password of the redis server. | password |
| REDIS_PORT | Redis server port. | 6379 |
| REDIS_SSL | Whether to enable SSL support. | false |
| REDIS_USERNAME | Login username of the redis server | default |
| SENTRY_DSN | A Sentry error monitoring Data Source Name. (Optional) |
The Conditions of Joining event should be sent to the COJ_PUBLISHED_QUEUE, with
the following structure.
{
"personId": "47165",
"conditionsOfJoining": {
"syncedAt": "2022-08-01T22:01:02Z"
}
}Spring Actuator is included to provide a health check endpoint, which can be
accessed at <host>:<port>/notifications/actuator/health.
The Gradle test task can be used to run automated tests and produce coverage
reports.
gradlew testThe Gradle check lifecycle task can be used to run automated tests and also
verify formatting conforms to the code style guidelines.
gradlew checkgradlew bootBuildImageThis project uses Semantic Versioning.
MySQL is no longer required to run the Notification Service, as the Quartz scheduler has been replaced with a MongoDB/cronjob based scheduler.
No specific migration steps are required, but database infrastructure and configuration may be made redundant if not required by other services.
However, it recommended to upgrade to v2.18.0 as an intermediate step if
you want the Quartz tables to be automatically deleted. If upgrading direct to
v3.0.0, permanent removal of the Quartz data/tables will be a manual process.
This project is license under The MIT License (MIT).