File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ framework :
2+ website : docs.spring.io/spring-framework/reference/web/webflux.html
3+ version : 3.1
4+
5+ binaries :
6+ - target/benchmark-webflux-1.0.0.jar
7+
8+ command : /usr/bin/java -jar /opt/web/target/benchmark-webflux-1.0.0.jar
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <project xmlns =" http://maven.apache.org/POM/4.0.0" xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3+ xsi:schemaLocation=" http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" >
4+ <modelVersion >4.0.0</modelVersion >
5+ <parent >
6+ <groupId >org.springframework.boot</groupId >
7+ <artifactId >spring-boot-starter-parent</artifactId >
8+ <version >[3.1,3.2)</version >
9+ <relativePath />
10+ </parent >
11+ <groupId >framework</groupId >
12+ <artifactId >benchmark-webflux</artifactId >
13+ <version >1.0.0</version >
14+ <name >benchmark-webflux</name >
15+ <description >Benchmark for Spring WebFlux</description >
16+ <properties >
17+ <java .version>17</java .version>
18+ </properties >
19+ <dependencies >
20+ <dependency >
21+ <groupId >org.springframework.boot</groupId >
22+ <artifactId >spring-boot-starter-webflux</artifactId >
23+ </dependency >
24+ </dependencies >
25+
26+ <build >
27+ <plugins >
28+ <plugin >
29+ <groupId >org.springframework.boot</groupId >
30+ <artifactId >spring-boot-maven-plugin</artifactId >
31+ <configuration >
32+ <image >
33+ <builder >paketobuildpacks/builder-jammy-base:latest</builder >
34+ </image >
35+ </configuration >
36+ </plugin >
37+ </plugins >
38+ </build >
39+
40+ </project >
Original file line number Diff line number Diff line change 1+ package framework .benchmark ;
2+
3+ import org .springframework .boot .SpringApplication ;
4+ import org .springframework .boot .autoconfigure .SpringBootApplication ;
5+
6+ @ SpringBootApplication
7+ public class BenchmarkApplication {
8+
9+ public static void main (String [] args ) {
10+ SpringApplication .run (BenchmarkApplication .class , args );
11+ }
12+
13+ }
Original file line number Diff line number Diff line change 1+ package framework .benchmark .controller ;
2+
3+ import org .springframework .web .bind .annotation .GetMapping ;
4+ import org .springframework .web .bind .annotation .PathVariable ;
5+ import org .springframework .web .bind .annotation .PostMapping ;
6+ import org .springframework .web .bind .annotation .RestController ;
7+ import reactor .core .publisher .Mono ;
8+
9+ @ RestController
10+ public class BenchmarkController {
11+
12+ private static final String EMPTY = "" ;
13+
14+ @ GetMapping ("/" )
15+ public Mono <String > root () {
16+ return Mono .just (EMPTY );
17+ }
18+
19+ @ GetMapping ("/user/{id}" )
20+ public Mono <Integer > userId (@ PathVariable Integer id ) {
21+ return Mono .just (id );
22+ }
23+
24+ @ PostMapping ("/user" )
25+ public Mono <String > user () {
26+ return Mono .just (EMPTY );
27+ }
28+ }
Original file line number Diff line number Diff line change 1+ server.port =3000
2+ server.error.whitelabel.enabled =false
3+ logging.level.root =ERROR
Original file line number Diff line number Diff line change 1313 <artifactId >benchmark</artifactId >
1414 <version >1.0.0</version >
1515 <name >benchmark</name >
16- <description >Demo project for Spring Boot </description >
16+ <description >Benchmark for Spring Web Mvc (thread per request model) </description >
1717
1818 <properties >
1919 <java .version>17</java .version>
2222 <dependencies >
2323 <dependency >
2424 <groupId >org.springframework.boot</groupId >
25- <artifactId >spring-boot-starter-webflux </artifactId >
25+ <artifactId >spring-boot-starter-web </artifactId >
2626 </dependency >
2727
2828 </dependencies >
You can’t perform that action at this time.
0 commit comments