Skip to content

Commit d5af11f

Browse files
committed
Add virtual thread module. Update springboot 3.2 base module.
1 parent 7b710a1 commit d5af11f

File tree

23 files changed

+272
-308
lines changed

23 files changed

+272
-308
lines changed

atomix/pom.xml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
<parent>
7+
<groupId>ie.emeraldjava</groupId>
8+
<artifactId>spring</artifactId>
9+
<version>0.0.1-SNAPSHOT</version>
10+
</parent>
11+
12+
<artifactId>atomix</artifactId>
13+
14+
<properties>
15+
<maven.compiler.source>21</maven.compiler.source>
16+
<maven.compiler.target>21</maven.compiler.target>
17+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
18+
</properties>
19+
20+
</project>

debezium/docker-compose.yml

+14-7
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,38 @@ services:
55
container_name: db
66
image: postgres:latest
77
restart: always
8-
#network_mode: host
8+
networks:
9+
host: {}
910
environment:
1011
- POSTGRES_USER=postgres
1112
- POSTGRES_PASSWORD=postgres
1213
ports:
13-
- 5432:5432
14+
- 5432:5435
1415
volumes:
15-
- ./postgres_data:/var/lib/postgresql/data
16+
- ./target/postgres_data:/var/lib/postgresql/data
1617
# https://stackoverflow.com/questions/26598738/how-to-create-user-database-in-script-for-docker-postgres
1718
- ./src/main/resources/dml/schema.sql:/docker-entrypoint-initdb.d/1-schema.sql
18-
command: [ "postgres", "-c", "wal_level=logical" ]
19+
# https://www.postgresql.org/docs/current/runtime-config-wal.html
20+
command: [ "postgres", "-c", "wal_level=replica" ] # replica is default, wal_level=logical
1921
adminer:
2022
container_name: adminer
2123
image: adminer:latest
2224
restart: always
23-
#network_mode: host
25+
networks:
26+
host: {}
2427
depends_on:
2528
- db
2629
ports:
27-
- 80:8080
30+
- 8080:8080
2831

2932
# docker networking!
3033
# https://stackoverflow.com/questions/56582446/how-to-use-host-network-for-docker-compose
3134
# https://stackoverflow.com/questions/70725881/what-is-the-equivalent-of-add-host-host-docker-internalhost-gateway-in-a-comp
3235
# networks:
3336
# mynetwork:
3437
# external: true
35-
# name: host
38+
# name: host
39+
networks:
40+
host:
41+
name: host
42+
external: true

debezium/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@
115115
<executions>
116116
<execution>
117117
<id>start</id>
118-
<!--<phase>pre-integration-test</phase>-->
119-
<phase>generate-test-resources</phase>
118+
<phase>pre-integration-test</phase>
119+
<!-- <phase>generate-test-resources</phase>-->
120120
<goals>
121121
<goal>build</goal>
122122
<goal>start</goal>

debezium/readme.md

+29-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,37 @@
11
# debezium
22

3+
## 15-09-2024
4+
5+
192.168.65.0/24
6+
7+
https://debezium.io/documentation/reference/stable/connectors/postgresql.html
8+
9+
### Set WAL Level
10+
11+
ALTER SYSTEM SET wal_level = logical;
12+
13+
https://stackoverflow.com/questions/67490668/changing-wal-level-on-postgresql-13-via-client-session-is-not-being-respecte
14+
https://blog.peerdb.io/exploring-versions-of-the-postgres-logical-replication-protocol
15+
https://medium.com/@film42/getting-postgres-logical-replication-changes-using-pgoutput-plugin-b752e57bfd58
16+
17+
18+
### Docker Networking
19+
20+
https://www.docker.com/blog/how-docker-desktop-networking-works-under-the-hood/
21+
https://stackoverflow.com/questions/73674365/how-to-use-a-pre-existing-network-in-docker-compose
22+
23+
324
## 14-09-2024
425

526
https://www.baeldung.com/debezium-intro
627
https://ishansoninitj.medium.com/change-data-capture-cdc-using-debezium-in-a-springboot-application-97ddde8b991a
728
https://gist.github.com/tzolov/c3bfa56237f0d4ceb53a93b6c80436e3
829
https://github.com/tzolov/cdc-debezium/tree/master
930

31+
## CDC
32+
33+
https://medium.com/yazilim-vip/cdc-with-debezium-kafka-spring-boot-3-and-postgres-a523d5237cca
34+
1035
### Avro
1136

1237
https://debezium.io/documentation/reference/stable/configuration/avro.html
@@ -26,4 +51,7 @@ https://github.com/rayanegouda/medium/tree/main/step1
2651

2752
https://debezium.io/documentation/reference/stable/connectors/postgresql.html
2853

29-
![img.png](img.png)
54+
http://localhost:8080/?pgsql=db&username=postgres&db=postgres&ns=the_simpsons&sql=
55+
https://www.postgresql.org/docs/current/logicaldecoding-walsender.html
56+
57+
https://stackoverflow.com/questions/64051373/way-to-configure-localhost-to-mean-only-127-0-0-1-or-turn-off-ipv6-in-mac

debezium/src/main/resources/dml/schema.sql

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@ CREATE TRIGGER maj_date_trigger
2626
FOR EACH ROW
2727
EXECUTE FUNCTION maj_date();
2828
------/*Tres utile pour obtenir des details dans la section before de la donnée*/
29-
ALTER TABLE the_simpsons.character REPLICA IDENTITY FULL;
29+
ALTER TABLE the_simpsons.character REPLICA IDENTITY FULL;
30+
---
31+
SELECT * FROM the_simpsons.character;

pom.xml

+17-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<module>joinfaces</module>
3131
<module>yaml-properties</module>
3232
<module>httpbin-gateway</module>
33-
<module>springboot3</module>
33+
<module>spring-boot-3-2</module>
3434
<module>vuejs-webjar</module>
3535
<module>graalvm</module>
3636
<module>vuejs-npm</module>
@@ -45,6 +45,21 @@
4545
<module>reactive</module>
4646
<module>js-remix-sb</module>
4747
<module>debezium</module>
48-
</modules>
48+
<module>atomix</module>
49+
<module>spring-boot-2-7</module>
50+
<module>spring-boot-3-2/virtual-threads</module>
51+
</modules>
52+
53+
<dependencyManagement>
54+
<dependencies>
55+
<dependency>
56+
<groupId>org.springframework.boot</groupId>
57+
<artifactId>spring-boot-dependencies</artifactId>
58+
<version>3.1.5</version>
59+
<type>pom</type>
60+
<scope>import</scope>
61+
</dependency>
62+
</dependencies>
63+
</dependencyManagement>
4964

5065
</project>

spring-boot-2-7/pom.xml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
<!-- <parent>-->
7+
<!-- <groupId>org.springframework.boot</groupId>-->
8+
<!-- <artifactId>spring-boot-starter-parent</artifactId>-->
9+
<!-- <version>2.7.11</version>-->
10+
<!-- <relativePath/> &lt;!&ndash; lookup parent from repository &ndash;&gt;-->
11+
<!-- </parent>-->
12+
13+
<groupId>io.github.emeraldjava.spring</groupId>
14+
<artifactId>spring-boot-2-7</artifactId>
15+
<name>tarter-v2.7</name>
16+
<version>1.0-SNAPSHOT</version>
17+
<packaging>pom</packaging>
18+
19+
<dependencyManagement>
20+
<dependencies>
21+
<dependency>
22+
<groupId>org.springframework.boot</groupId>
23+
<artifactId>spring-boot-dependencies</artifactId>
24+
<version>3.1.5</version>
25+
<type>pom</type>
26+
<scope>import</scope>
27+
</dependency>
28+
</dependencies>
29+
</dependencyManagement>
30+
31+
<properties>
32+
<maven.compiler.source>21</maven.compiler.source>
33+
<maven.compiler.target>21</maven.compiler.target>
34+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
35+
</properties>
36+
37+
</project>

spring-boot-3-2/pom.xml

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
<!-- <parent>-->
7+
<!-- <groupId>org.springframework.boot</groupId>-->
8+
<!-- <artifactId>spring-boot-starter-parent</artifactId>-->
9+
<!-- <version>3.2.8</version>-->
10+
<!-- </parent>-->
11+
12+
<groupId>com.github.emeraldjava</groupId>
13+
<artifactId>spring-boot-3-2</artifactId>
14+
<version>1.0-SNAPSHOT</version>
15+
<name>spring-boot-3-2</name>
16+
<packaging>pom</packaging>
17+
18+
<properties>
19+
<maven.compiler.source>21</maven.compiler.source>
20+
<maven.compiler.target>21</maven.compiler.target>
21+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
22+
<spring-boot.version>3.3.4</spring-boot.version>
23+
<springdoc-openapi-webmvc-ui.version>2.5.0</springdoc-openapi-webmvc-ui.version>
24+
</properties>
25+
26+
<dependencyManagement>
27+
<dependencies>
28+
<dependency>
29+
<groupId>org.junit</groupId>
30+
<artifactId>junit-bom</artifactId>
31+
<version>5.10.3</version>
32+
<!-- <version>${junit-jupiter.version}</version>-->
33+
<type>pom</type>
34+
<scope>import</scope>
35+
</dependency>
36+
<dependency>
37+
<groupId>org.springframework.boot</groupId>
38+
<artifactId>spring-boot-dependencies</artifactId>
39+
<version>${spring-boot.version}</version>
40+
<type>pom</type>
41+
<scope>import</scope>
42+
</dependency>
43+
</dependencies>
44+
</dependencyManagement>
45+
46+
<build>
47+
<plugins>
48+
<plugin>
49+
<groupId>org.springframework.boot</groupId>
50+
<artifactId>spring-boot-maven-plugin</artifactId>
51+
<executions>
52+
<execution>
53+
<goals>
54+
<goal>build-info</goal>
55+
<goal>repackage</goal>
56+
</goals>
57+
</execution>
58+
</executions>
59+
</plugin>
60+
</plugins>
61+
</build>
62+
63+
</project>

springboot3/readme.md renamed to spring-boot-3-2/readme.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
# spring boot 3.2
22

3-
## 05-08-2024
3+
## 2024-09-28
4+
5+
https://callistaenterprise.se/blogg/teknik/2024/06/03/microservices-upgrade-to-SpringBoot32/
6+
7+
## 2024-08-05
48

59
Add vue app with [htm](https://github.com/developit/htm)
610

711
- https://markus.oberlehner.net/blog/goodbye-webpack-building-vue-applications-without-webpack/
812
- https://github.com/maoberlehner/goodbye-webpack-building-vue-applications-without-webpack/blob/master/src/utils/html.js
913

10-
## 04-08-2024
14+
## 2024-08-04
1115

1216
Lost too much time with mac os and firefox not resoloving http://localhost:8080/ cirrectly. Works in Chrome.
1317

14-
## 02-08-2024
18+
## 2024-08-02
1519

1620
Add vue js app with self host
1721

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
<parent>
7+
<groupId>com.github.emeraldjava</groupId>
8+
<artifactId>spring-boot-3-2</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
<relativePath>../pom.xml</relativePath>
11+
</parent>
12+
13+
<artifactId>virtual-threads</artifactId>
14+
<packaging>jar</packaging>
15+
16+
<dependencies>
17+
<dependency>
18+
<groupId>org.springframework.boot</groupId>
19+
<artifactId>spring-boot-starter-web</artifactId>
20+
</dependency>
21+
<dependency>
22+
<groupId>org.springframework.boot</groupId>
23+
<artifactId>spring-boot-starter-actuator</artifactId>
24+
</dependency>
25+
<dependency>
26+
<groupId>org.springframework.boot</groupId>
27+
<artifactId>spring-boot-starter-test</artifactId>
28+
<scope>test</scope>
29+
</dependency>
30+
<dependency>
31+
<groupId>org.springframework.boot</groupId>
32+
<artifactId>spring-boot-devtools</artifactId>
33+
<scope>runtime</scope>
34+
<optional>true</optional>
35+
</dependency>
36+
</dependencies>
37+
38+
<build>
39+
<plugins>
40+
<plugin>
41+
<groupId>org.springframework.boot</groupId>
42+
<artifactId>spring-boot-maven-plugin</artifactId>
43+
</plugin>
44+
</plugins>
45+
</build>
46+
47+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# virtual threads
2+
3+
spring 3.2, java 21 and virtual threads.
4+
5+
## 2024-09-28
6+
7+
See
8+
- https://bell-sw.com/blog/a-guide-to-using-virtual-threads-with-spring-boot/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package io.github.emeraldjava.spring.virtualthreads;
2+
3+
import org.springframework.boot.SpringApplication;
4+
import org.springframework.boot.autoconfigure.SpringBootApplication;
5+
6+
@SpringBootApplication
7+
public class VirtualThreadApp {
8+
9+
public static void main(String[] args) {
10+
SpringApplication.run(VirtualThreadApp.class, args);
11+
}
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# use virtual threads
2+
# See https://bell-sw.com/blog/a-guide-to-using-virtual-threads-with-spring-boot/
3+
spring:
4+
threads:
5+
virtual:
6+
enabled: true
7+
8+
management:
9+
endpoints:
10+
web:
11+
exposure:
12+
include: '*'
13+
#health,info,beans,metrics,startup

0 commit comments

Comments
 (0)