https://github.com/crisandolindesmanrumahorbo/reactive-spring-webclient
Spring boot with WebClient and WebTestClient
https://github.com/crisandolindesmanrumahorbo/reactive-spring-webclient
java spring spring-boot unit-testing webclient webflux-client webtestclient
Last synced: 28 days ago
JSON representation
Spring boot with WebClient and WebTestClient
- Host: GitHub
- URL: https://github.com/crisandolindesmanrumahorbo/reactive-spring-webclient
- Owner: crisandolindesmanrumahorbo
- License: mit
- Created: 2022-06-12T09:06:21.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-07-25T08:19:10.000Z (almost 4 years ago)
- Last Synced: 2025-03-02T04:41:58.530Z (over 1 year ago)
- Topics: java, spring, spring-boot, unit-testing, webclient, webflux-client, webtestclient
- Language: Java
- Homepage:
- Size: 21.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
## Reactive WebClient on Spring Boot
https://www.baeldung.com/spring-5-webclient
Generic Java Reference
https://www.geeksforgeeks.org/generics-in-java/
Unit Testing Reference
https://howtodoinjava.com/spring-webflux/webfluxtest-with-webtestclient/
Component scan reference
https://www.baeldung.com/spring-nosuchbeandefinitionexception
Factory pattern
https://www.geeksforgeeks.org/factory-method-design-pattern-in-java/
If we run use Tomcat Servlet Container, the service implement Tomcat NIO Connector which support Non Blocking / Async.
https://dzone.com/articles/understanding-tomcat-nio
By default, webflux run with Netty Servlet Container, Netty implement Java NIO too.
https://www.baeldung.com/spring-webflux-concurrency
Java NIO: https://jenkov.com/tutorials/java-nio/index.html
#### Netty
##### How to run using Netty Server?
Just exclude the default tomcat server
```
org.springframework.boot
spring-boot-starter-web
org.springframework.boot
spring-boot-starter-tomcat
```
If we run use Netty Server, and trying to hit endpoint sync (which use block()), will display this error.
```
java.lang.IllegalStateException: block()/blockFirst()/blockLast() are blocking, which is not supported in thread reactor-http-nio-3
```
#### Netty only support nonblock, if want to run nonblock and block api use tomcat or undertow.
#### JMeter
How to Run?
```
cd apache-jmeter-5.4.3/bin
sh jmeter.sh
```