Creating the Mail microservice
Now, we will create our Mail
microservice. The name is self-explanatory, this component will be responsible for sending emails. We will not configure an SMTP (Simple Mail Transfer Protocol) server, we will use SendGrid.
SendGrid is an SaaS (Software as a Service) service for emails, we will use this service to send emails to our Airline Ticket System. There are some triggers to send email, for example, when the user creates a booking and when the payment is accepted.
Our Mail
microservice will listen to a queue. Then the integration will be done using the message broker. We choose this strategy because we do not need the feature that enables us to answer synchronously. Another essential characteristic is the retry policy when the communication is broken. This behavior can be done easily using the message strategy.
We are using RabbitMQ as a message broker. For this project, we will use RabbitMQ Reactor, which is a reactive implementation of RabbitMQ Java client...