使用Reactive编程的优点:更有效的使用机器资源,和阻塞式的springMVC应用程度不同,可以使用更少的线程处理更多的请求。
- 启动delayService,报错如下:
Caused by: java.lang.ClassNotFoundException: org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType
经过查询,application.Java 文件不能直接放在main/java文件夹下,必须要建一个包把他放进去...
2.启动blockingapp和reactiveApp
压力测试对比
class LoadSimulation extends Simulation { val targetUrl = System.getProperty("TARGET_URL") val simUsers = System.getProperty("SIM_USERS").toInt val myScenario = scenario("Webflux Demo").exec( repeat(30) { exec( http("request_1").get("http://localhost:8081/300") ).pause(1 second, 2 seconds) } ) setUp(myScen