Checkout across services
Creating an order calls the customer and product services, saves the order lines, requests payment, then publishes a Kafka event.
E-commerce backend
An e-commerce backend split into microservices, with Kafka passing events between them and Keycloak handling login.
Easy-Buy is an e-commerce backend split into eight services. A customer sends an order to the gateway. The order service checks that the customer exists, asks the product service to take the stock out, records the order lines, requests payment, and publishes a confirmation. The notification service picks that up and emails the customer. Keycloak handles login, and the services keep their data in PostgreSQL and MongoDB.
Requests go through the API gateway, where the Keycloak token check starts. Behind it, each service registers with Eureka and reads its settings from the config server; an order is put together with OpenFeign for the customer lookup and RestTemplate for the product purchase. Payment and order events both go to Kafka, and the notification service turns them into email.
Supporting infrastructure: Spring Cloud Config + Eureka Discovery
Component overview. The payment service does not establish real payment processing.
Creating an order calls the customer and product services, saves the order lines, requests payment, then publishes a Kafka event.
The product service refuses the order when the quantity is not available, so stock cannot go negative.
The notification service consumes order and payment events and sends the matching email template.
A config server holds the shared settings and Eureka registers each service, so URLs and ports live in one place.