In this second article discussing the AuthenticationService, we cover several areas. First, we introduce the user credentials and privileges role data model and the Spring repositories used to persist the data. We also look at the service's event publisher, the JSON Web Token (JWT) provider, and the email client the service uses to send messages to the Notification Service.
In the previous three articles, we created two services, the OutboundEmailService and the OutboundSMSService. Both of these services can be called directly via their respective REST endpoints. However, Calling these services directly can potentially cause contention when the service is under heavy load. We did, however, anticipate this situation when creating the services by including a message queue listener. In this article, we will build the NotificationService, which accepts both email and SMS/MMS message requests, and enqueues the message in the respective message queue topics. This approach reduces the concurrent load on each of the messaging services. After the NotificationService is constructed, we will exercise it using its generated Swagger interface, and view its operational metrics using the corresponding Grafana dashboard.