The Basket service is a simple CRUD data-driven microservice that manages user baskets. All endpoints are available only for all users who own a JWT token that contains "basket" scope and "basket-service" audience.
In case of basket checkout, it publishes UserCheckoutAcceptedIntegrationEvent to initiate the order process. It also handles two integration events:
-
OrderStartedIntegrationEvent
To delete user's basket when the order process has started.
-
ProductPriceChangedIntegrationEventHandler
To update the price of the product in the basket.
The Basket service uses Redis for persistence.
The best way to run the service is with IDE like IntelliJ IDEA or Eclipse. Alternatively, after you build the service, you can run it with the following command:
~ java -jar services/basket/build/libs/basket.jar
Optional profiles:
- elk - to enable ELK logging.
- distributed-tracing - to enable distributed tracing with Sleuth and Zipking.
- docker - used when the service is run with docker.