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 ...

Get Spring 5.0 By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.