This project is a sample Spring Cloud application that implements a microservices architecture with services like product and order management, and an API gateway for service routing.
Ensure Java and Maven are installed on your system and the JAVA_HOME environment variable is set.
shop_product and shop_order.The project includes the following microservices:
Each service has its own application.yml or application.properties file in the src/main/resources directory where you can set up the datasource, server port, and other configurations.
server.port: The port on which the service will run.spring.application.name: The name of the application in the service registry.spring.datasource: The datasource configuration.spring.jpa: The JPA/Hibernate configuration.spring.cloud.nacos.discovery.server-addr: The address of the Nacos server.Each microservice can be started with the Spring Boot Maven plugin. Below are the commands to start each service:
cd api-gateway
mvn spring-boot:run
To start the shop-product-api, run the following command:
cd shop-product-api
mvn spring-boot:run
To start the shop-product-server, use this command:
cd shop-product-server
mvn spring-boot:run
Start the shop-order-api with:
cd shop-order-api
mvn spring-boot:run
To launch the shop-order-server, execute:
cd shop-order-server
mvn spring-boot:run
sh startup.sh -m standalone
startup.cmd -m standalone
Alibaba Sentinel provides a dashboard for monitoring and managing rules in a graphical interface.
To start the Sentinel dashboard, execute the following command in the directory where Sentinel is located
java -Dserver.port=8080 -jar sentinel-dashboard-1.8.0.jar
Apache JMeter is an open-source load testing tool. You can use it to test the performance and stability of your services under different load conditions.
jmeter command in the bin directory of JMeter.To integrate JMeter with Sentinel, you need to:
pom.xml.$ claude mcp add springcloud1-sample \
-- python -m otcore.mcp_server <graph>