Spring WebFlux Benchmark (#6920) · grepjava/web-frameworks@fd64735 · GitHub
Skip to content

Commit fd64735

Browse files
authored
Spring WebFlux Benchmark (the-benchmarker#6920)
* feat(Spring Web Flux): Adding Spring Web Flux to the-benchmark * fix: Replace Spring WebFlux dependency with Spring WebMVC Originally, the project combined Spring WebFlux dependency with Spring WebMVC implementation. It has now been restructured to two separate projects for each Spring Boot variant - one for Spring WebFlux (spring-webflux) and another for Spring WebMVC(spring). * chore: back to range versions
1 parent 21f1c0d commit fd64735

6 files changed

Lines changed: 94 additions & 2 deletions

File tree

‎java/spring-webflux/config.yaml‎

Lines changed: 8 additions & 0 deletions

‎java/spring-webflux/pom.xml‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
server.port=3000
2+
server.error.whitelabel.enabled=false
3+
logging.level.root=ERROR

‎java/spring/pom.xml‎

Lines changed: 2 additions & 2 deletions

0 commit comments

Comments
 (0)