Jak*_*ski 16 java spring nonblocking spring-boot spring-webflux
我只是通过示例PoC项目在简单的常见场景中测试一些阻塞/非阻塞解决方案.
我已经使用WebFlux测试了当前(阻塞)Spring启动客户端(tomcat),Spring Boot 2.0(netty) - WebClient,Ratpack和Lagom.在每种情况下,我都通过gatling测试简单场景(100-1000个用户/秒)强调了客户端应用程序.
我已经测试了ratpack和lagom作为参考非阻塞io服务器,以将结果与spring boot(阻塞和非阻塞)进行比较.
在所有情况下,我都有预期的结果,除了Spring boot 2.0测试.它仅适用于小负载水平,但即便如此,也具有高延迟.如果负载水平上升 - 所有请求都是时间.
WebClient用法:
@RestController
public class NonBlockingClientController {
private WebClient client = WebClient.create("http://localhost:9000");
@GetMapping("/client")
public Mono<String> getData() {
return client.get()
.uri("/routing")
.accept(TEXT_PLAIN)
.exchange()
.then(response -> response.bodyToMono(String.class));
}
}
Run Code Online (Sandbox Code Playgroud)
我不知道出了什么问题或当前的快照版本只是工作.
所有来源均发布于https://github.com/rutkowskij/blocking-non-blocking-poc
我刚刚使用spring-boot-starter-webflux和版本2.0.0.BUILD-SNAPSHOT创建了一个简单的Spring Boot应用程序,它带来了spring-webflux版本5.0.0.BUILD-SNAPSHOT和Spring Core,Beans,Context等相同.
5.0 RC4发布后问题不再存在.该问题与reactor-netty和reactor-core中的连接池有关.
我也用Spring Boot 2.0.0.M4进行了测试 - 现在一切都很好看.
详情:http://jira.spring.io/browse/SPR-15584
| 归档时间: |
|
| 查看次数: |
2925 次 |
| 最近记录: |