Skip to content

Commit 1c8aa6b

Browse files
committed
Update dependencies + simplify example
1 parent 0409a1d commit 1c8aa6b

File tree

4 files changed

+160
-168
lines changed

4 files changed

+160
-168
lines changed

blocking-service/pom.xml

+67-69
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,74 @@
11
<?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>2.6.3</version>
9-
<relativePath/> <!-- lookup parent from repository -->
10-
</parent>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<parent>
5+
<groupId>org.springframework.boot</groupId>
6+
<artifactId>spring-boot-starter-parent</artifactId>
7+
<version>2.7.3</version>
8+
<relativePath /> <!-- lookup parent from repository -->
9+
</parent>
1110

12-
<groupId>com.example</groupId>
13-
<artifactId>blocking-service</artifactId>
14-
<version>0.0.1-SNAPSHOT</version>
15-
<name>blocking-service</name>
16-
<description>blocking-service</description>
11+
<groupId>com.example</groupId>
12+
<artifactId>blocking-service</artifactId>
13+
<version>0.0.1-SNAPSHOT</version>
14+
<name>blocking-service</name>
1715

18-
<properties>
19-
<java.version>17</java.version>
20-
</properties>
16+
<properties>
17+
<java.version>17</java.version>
18+
</properties>
2119

22-
<dependencies>
23-
<dependency>
24-
<groupId>org.springframework.boot</groupId>
25-
<artifactId>spring-boot-starter-data-jpa</artifactId>
26-
</dependency>
27-
<dependency>
28-
<groupId>org.springframework.boot</groupId>
29-
<artifactId>spring-boot-starter-web</artifactId>
30-
</dependency>
31-
<dependency>
32-
<groupId>org.springframework.boot</groupId>
33-
<artifactId>spring-boot-starter-security</artifactId>
34-
</dependency>
20+
<dependencies>
21+
<dependency>
22+
<groupId>org.springframework.boot</groupId>
23+
<artifactId>spring-boot-starter-data-jpa</artifactId>
24+
</dependency>
25+
<dependency>
26+
<groupId>org.springframework.boot</groupId>
27+
<artifactId>spring-boot-starter-web</artifactId>
28+
</dependency>
29+
<dependency>
30+
<groupId>org.springframework.boot</groupId>
31+
<artifactId>spring-boot-starter-security</artifactId>
32+
</dependency>
3533

36-
<dependency>
37-
<groupId>org.springframework.boot</groupId>
38-
<artifactId>spring-boot-devtools</artifactId>
39-
<scope>runtime</scope>
40-
<optional>true</optional>
41-
</dependency>
42-
<dependency>
43-
<groupId>org.mariadb.jdbc</groupId>
44-
<artifactId>mariadb-java-client</artifactId>
45-
<scope>runtime</scope>
46-
</dependency>
47-
<dependency>
48-
<groupId>org.projectlombok</groupId>
49-
<artifactId>lombok</artifactId>
50-
<optional>true</optional>
51-
</dependency>
52-
<dependency>
53-
<groupId>org.springframework.boot</groupId>
54-
<artifactId>spring-boot-starter-test</artifactId>
55-
<scope>test</scope>
56-
</dependency>
57-
</dependencies>
34+
<dependency>
35+
<groupId>org.springframework.boot</groupId>
36+
<artifactId>spring-boot-devtools</artifactId>
37+
<scope>runtime</scope>
38+
<optional>true</optional>
39+
</dependency>
40+
<dependency>
41+
<groupId>org.mariadb.jdbc</groupId>
42+
<artifactId>mariadb-java-client</artifactId>
43+
<scope>runtime</scope>
44+
</dependency>
45+
<dependency>
46+
<groupId>org.projectlombok</groupId>
47+
<artifactId>lombok</artifactId>
48+
<optional>true</optional>
49+
</dependency>
50+
<dependency>
51+
<groupId>org.springframework.boot</groupId>
52+
<artifactId>spring-boot-starter-test</artifactId>
53+
<scope>test</scope>
54+
</dependency>
55+
</dependencies>
5856

59-
<build>
60-
<plugins>
61-
<plugin>
62-
<groupId>org.springframework.boot</groupId>
63-
<artifactId>spring-boot-maven-plugin</artifactId>
64-
<configuration>
65-
<excludes>
66-
<exclude>
67-
<groupId>org.projectlombok</groupId>
68-
<artifactId>lombok</artifactId>
69-
</exclude>
70-
</excludes>
71-
</configuration>
72-
</plugin>
73-
</plugins>
74-
</build>
57+
<build>
58+
<plugins>
59+
<plugin>
60+
<groupId>org.springframework.boot</groupId>
61+
<artifactId>spring-boot-maven-plugin</artifactId>
62+
<configuration>
63+
<excludes>
64+
<exclude>
65+
<groupId>org.projectlombok</groupId>
66+
<artifactId>lombok</artifactId>
67+
</exclude>
68+
</excludes>
69+
</configuration>
70+
</plugin>
71+
</plugins>
72+
</build>
7573

76-
</project>
74+
</project>

reactive-programming/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<dependency>
1919
<groupId>io.projectreactor</groupId>
2020
<artifactId>reactor-bom</artifactId>
21-
<version>2020.0.15</version>
21+
<version>2020.0.22</version>
2222
<type>pom</type>
2323
<scope>import</scope>
2424
</dependency>
@@ -38,7 +38,7 @@
3838
<dependency>
3939
<groupId>org.projectlombok</groupId>
4040
<artifactId>lombok</artifactId>
41-
<version>1.18.22</version>
41+
<version>1.18.24</version>
4242
<optional>true</optional>
4343
</dependency>
4444
</dependencies>
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
package com.example;
22

3-
import java.util.concurrent.ExecutorService;
4-
import java.util.concurrent.Executors;
3+
import java.util.concurrent.TimeUnit;
54

65
public class Application {
76

8-
public static void main(String[] args) {
9-
ExecutorService threadPool = Executors.newFixedThreadPool(1);
7+
public static void main(String[] args) throws InterruptedException {
8+
for (int u = 1; u <= 10; u++) {
9+
var user = "User " + u;
10+
Service.getFlux()
11+
.map(i -> user + " - " + i)
12+
.subscribe(System.out::println);
13+
}
1014

11-
for (int u = 1; u <= 10; u++) {
12-
var user = "User " + u;
13-
System.out.println("Submitting task " + u);
14-
threadPool.submit(() -> {
15-
Service.getFlux()
16-
.map(i -> user + " - " + i)
17-
.subscribe(System.out::println);
18-
});
19-
}
20-
}
15+
TimeUnit.SECONDS.sleep(5);
16+
}
2117

2218
}

reactive-service/pom.xml

+81-83
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,88 @@
11
<?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>2.6.3</version>
9-
<relativePath/> <!-- lookup parent from repository -->
10-
</parent>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<parent>
5+
<groupId>org.springframework.boot</groupId>
6+
<artifactId>spring-boot-starter-parent</artifactId>
7+
<version>2.7.3</version>
8+
<relativePath /> <!-- lookup parent from repository -->
9+
</parent>
1110

12-
<groupId>com.example</groupId>
13-
<artifactId>reactive-service</artifactId>
14-
<version>0.0.1-SNAPSHOT</version>
15-
<name>reactive-service</name>
16-
<description>reactive-service</description>
11+
<groupId>com.example</groupId>
12+
<artifactId>reactive-service</artifactId>
13+
<version>0.0.1-SNAPSHOT</version>
14+
<name>reactive-service</name>
1715

18-
<properties>
19-
<java.version>17</java.version>
20-
</properties>
16+
<properties>
17+
<java.version>17</java.version>
18+
</properties>
2119

22-
<dependencies>
23-
<dependency>
24-
<groupId>org.springframework.boot</groupId>
25-
<artifactId>spring-boot-starter-data-r2dbc</artifactId>
26-
</dependency>
27-
<dependency>
28-
<groupId>org.springframework.boot</groupId>
29-
<artifactId>spring-boot-starter-security</artifactId>
30-
</dependency>
31-
<dependency>
32-
<groupId>org.springframework.boot</groupId>
33-
<artifactId>spring-boot-starter-webflux</artifactId>
34-
</dependency>
35-
<dependency>
36-
<groupId>io.netty</groupId>
37-
<artifactId>netty-all</artifactId>
38-
</dependency>
20+
<dependencies>
21+
<dependency>
22+
<groupId>org.springframework.boot</groupId>
23+
<artifactId>spring-boot-starter-data-r2dbc</artifactId>
24+
</dependency>
25+
<dependency>
26+
<groupId>org.springframework.boot</groupId>
27+
<artifactId>spring-boot-starter-security</artifactId>
28+
</dependency>
29+
<dependency>
30+
<groupId>org.springframework.boot</groupId>
31+
<artifactId>spring-boot-starter-webflux</artifactId>
32+
</dependency>
33+
<dependency>
34+
<groupId>io.netty</groupId>
35+
<artifactId>netty-all</artifactId>
36+
</dependency>
3937

40-
<dependency>
41-
<groupId>org.springframework.boot</groupId>
42-
<artifactId>spring-boot-devtools</artifactId>
43-
<scope>runtime</scope>
44-
<optional>true</optional>
45-
</dependency>
46-
<dependency>
47-
<groupId>org.mariadb</groupId>
48-
<artifactId>r2dbc-mariadb</artifactId>
49-
<scope>runtime</scope>
50-
</dependency>
51-
<dependency>
52-
<groupId>org.projectlombok</groupId>
53-
<artifactId>lombok</artifactId>
54-
<optional>true</optional>
55-
</dependency>
56-
<dependency>
57-
<groupId>org.springframework.boot</groupId>
58-
<artifactId>spring-boot-starter-test</artifactId>
59-
<scope>test</scope>
60-
</dependency>
61-
<dependency>
62-
<groupId>io.projectreactor</groupId>
63-
<artifactId>reactor-test</artifactId>
64-
<scope>test</scope>
65-
</dependency>
66-
<dependency>
67-
<groupId>org.springframework.security</groupId>
68-
<artifactId>spring-security-test</artifactId>
69-
<scope>test</scope>
70-
</dependency>
71-
</dependencies>
38+
<dependency>
39+
<groupId>org.springframework.boot</groupId>
40+
<artifactId>spring-boot-devtools</artifactId>
41+
<scope>runtime</scope>
42+
<optional>true</optional>
43+
</dependency>
44+
<dependency>
45+
<groupId>org.mariadb</groupId>
46+
<artifactId>r2dbc-mariadb</artifactId>
47+
<scope>runtime</scope>
48+
</dependency>
49+
<dependency>
50+
<groupId>org.projectlombok</groupId>
51+
<artifactId>lombok</artifactId>
52+
<optional>true</optional>
53+
</dependency>
54+
<dependency>
55+
<groupId>org.springframework.boot</groupId>
56+
<artifactId>spring-boot-starter-test</artifactId>
57+
<scope>test</scope>
58+
</dependency>
59+
<dependency>
60+
<groupId>io.projectreactor</groupId>
61+
<artifactId>reactor-test</artifactId>
62+
<scope>test</scope>
63+
</dependency>
64+
<dependency>
65+
<groupId>org.springframework.security</groupId>
66+
<artifactId>spring-security-test</artifactId>
67+
<scope>test</scope>
68+
</dependency>
69+
</dependencies>
7270

73-
<build>
74-
<plugins>
75-
<plugin>
76-
<groupId>org.springframework.boot</groupId>
77-
<artifactId>spring-boot-maven-plugin</artifactId>
78-
<configuration>
79-
<excludes>
80-
<exclude>
81-
<groupId>org.projectlombok</groupId>
82-
<artifactId>lombok</artifactId>
83-
</exclude>
84-
</excludes>
85-
</configuration>
86-
</plugin>
87-
</plugins>
88-
</build>
71+
<build>
72+
<plugins>
73+
<plugin>
74+
<groupId>org.springframework.boot</groupId>
75+
<artifactId>spring-boot-maven-plugin</artifactId>
76+
<configuration>
77+
<excludes>
78+
<exclude>
79+
<groupId>org.projectlombok</groupId>
80+
<artifactId>lombok</artifactId>
81+
</exclude>
82+
</excludes>
83+
</configuration>
84+
</plugin>
85+
</plugins>
86+
</build>
8987

90-
</project>
88+
</project>

0 commit comments

Comments
 (0)