This is an example of implementing a microservice architecture based on Java technologies. The purpose is to show how I would handle different kinds of communications for microservices, looking for better performance and the perfect tools depending on the context.
This is not a product or application in itself; it is just a showcase of how Spring technologies could be implemented.
Modules and Microservices
Api Gateway: It's the unique entry point for all users to the system. Use Spring Gateway to redirect all requests to the necessary microservice.
Common: Consist of different classes and services necessary for many microservices. It's used to avoid code duplication and can be imported as a dependency from any microservice.
Customer: Handle all customer and payment method information.
Docs: Contains all documentation and images used for any Design Doc.
Email Notification: Dedicated to all user's notification trough email. It isn't connected to API Gateway and use Kafka to communicate with other microservices.
Eureka Server: Use Spring Cloud Netflix Eureka to act like a discovery service and register all running microservice.
Loyalty: Handle all benefits for frequent customers.
Product: Handle product inventory classified by categories.
Security: Handle all service to create and validate JWT tokens, users, roles and permissions.
Shopping: Perform basic services for shopping modules like purchase.
Purchase Flow - Featured feature
Purchase flow
Each purchase needs to handle product inventory, loyalty points and email notifications. So, it's necessary to use Grpc and Kafka to microservices interactions from a new microservice called Shopping.
The goals for this feature are:
Add a new microservice Shopping.
Use grpc and kafka for microservices communication.
Validate inventory and lot points.
Send email notification.
Login and Privileges Validations - Featured feature
Login flow
I've been implemented Spring Security and JWT to handle login workflow and validate access to public and private resources.