Skip to content

Notification service

The Notification service, with Register service, allow interested consumers to subscribe to data and metadata changes using a publisher/subscriber pattern

Documentation

Official documentation home for Notification Service

Dependencies needed to run the code locally

  • JDK11
  • Maven
  • Azure Devops access to slb-des-ext-collaboration organization. You need to generate a PAT that can access dependencies held in the Azure artifacts
  • Working Register service endpoint

Build and run service locally

  • Build the service and run the unit tests. This step also generates the executable jar file. Run this command from the root folder, where parent pom.xml resides

Note: At runtime, you must set a Spring profile so the right runtime configuration gets picked up for your app. Since this is a Spring Boot application, runtime configuration is defined in one of the application properties files under <provider>->src->main->resources. You can set the right Spring Boot runtime profile with -Dspring.profiles.active=test. Please read this for more info.

mvn clean install
  • To run the service locally, navigate to provider/notification-<your_provider>/target directory and execute the spring-boot jar
java -jar notification-gc-1.0.0-spring-boot.jar
  • To debug service locally, create a remote debug configuration first and then use following command to start service in debug mode
java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=n -jar notification-gc-1.0.0-spring-boot.jar

Note: The port number "8000" in the command should match with the remote debug config settings.

Access the service

The port and path for the service endpoint can be configured in application.properties as following. If not specified, then the web container (ex. Tomcat) default is used:

server.servlet.contextPath=/
server.port=8080

Open API 3.0 - Swagger

  • Swagger UI : https://host/context-path/swagger (will redirect to https://host/context-path/swagger-ui/index.html)
  • api-docs (JSON) : https://host/context-path/api-docs
  • api-docs (YAML) : https://host/context-path/api-docs.yaml

All the Swagger and OpenAPI related common properties are managed here swagger.properties

Server Url(full path vs relative path) configuration

  • api.server.fullUrl.enabled=true It will generate full server url in the OpenAPI swagger
  • api.server.fullUrl.enabled=false It will generate only the contextPath only
  • default value is false (Currently only in Azure it is enabled)

AWS

Instructions for running and testing this service can be found here