File tree 13 files changed +202
-13
lines changed
mutiny-integration-examples
resteasy-reactive-examples
13 files changed +202
-13
lines changed Original file line number Diff line number Diff line change
1
+ # Chapter 8 - HTTP with Reactive in Mind
2
+
3
+ This directory contains the code from the _ Chapter 8 - HTTP with Reactive in Mind_ :
4
+
5
+ * [ benchmark - Compare RESTEasy and RESTEasy Reactive] ( ./simple-benchmark )
6
+ * [ resteasy reactive examples - Demonstrate how to use RESTEasy Reactive] ( ./resteasy-reactive-examples )
7
+ * [ mutiny-integration-examples - Various examples using SmallRye Mutiny] ( ./mutiny-integration-examples )
8
+ * [ reactive-scores - Demonstrates reactive score computation] ( ./reactive-scores )
Original file line number Diff line number Diff line change
1
+ # Mutiny Integration with RESTEasy Reactive
2
+
3
+ This module is a simple reactive application using Quarkus, REASTEasy Reactive and Mutiny.
4
+
5
+ ## Dev
6
+
7
+ You can run this application in dev mode using:
8
+
9
+ ``` shell
10
+ > mvn quarkus:dev
11
+ ```
12
+
13
+ The application is exposed on ` http://localhost:8080/ ` .
14
+ For example:
15
+
16
+ ``` shell
17
+ > curl http://localhost:8080/lorem
18
+ ```
19
+
20
+ ## Build
21
+
22
+ Build it the application package using:
23
+
24
+ ``` shell
25
+ > mvn clean package
26
+ ```
27
+
28
+ The output is located in ` target/quarkus-app `
29
+
30
+ ## Run
31
+
32
+ Once packaged, you can run the application with:
33
+
34
+ ``` shell
35
+ > java -jar target/quarkus-app/quarkus-run.jar
36
+ ```
Original file line number Diff line number Diff line change
1
+ # Reactive Score
2
+
3
+ This module illustrates the reactive score computation.
4
+
5
+ ## Dev
6
+
7
+ You can run this application in dev mode using:
8
+
9
+ ``` shell
10
+ > mvn quarkus:dev
11
+ ```
12
+
13
+ Then, open your browser to the Dev UI (http://localhost:8080/q/dev ) and click on _ Endpoint scores_ .
Original file line number Diff line number Diff line change
1
+ # RESTEasy Reactive Example
2
+
3
+ This module is a simple reactive application using Quarkus and RESTEasy Reactive.
4
+
5
+ ## Dev
6
+
7
+ You can run this application in dev mode using:
8
+
9
+ ``` shell
10
+ > mvn quarkus:dev
11
+ ```
12
+
13
+ The application is exposed on ` http://localhost:8080/hello-resteasy-reactive ` .
14
+ For example:
15
+
16
+ ``` shell
17
+ > curl http://localhost:8080/hello-resteasy-reactive
18
+ > curl http://localhost:8080/hello-resteasy-reactive/blocking
19
+ ```
20
+
21
+ ## Build
22
+
23
+ Build it the application package using:
24
+
25
+ ``` shell
26
+ > mvn clean package
27
+ ```
28
+
29
+ The output is located in ` target/quarkus-app `
30
+
31
+ ## Run
32
+
33
+ Once packaged, you can run the application with:
34
+
35
+ ``` shell
36
+ > java -jar target/quarkus-app/quarkus-run.jar
37
+ ```
Original file line number Diff line number Diff line change
1
+ # RESTEasy vs. RESTEasy Reactive Benchmark
2
+
3
+ This directory contains three variants of the same _ hello_ application:
4
+
5
+ * [ classic (RESTEasy classic)] ( ./classic )
6
+ * [ reactive (RESTEasy reactive)] ( ./reactive )
7
+ * [ reactive with blocking (RESTEasy reactive using a blocking signature)] ( ./reactive-blocking )
8
+
9
+ They all exposed the ` /hello ` endpoint.
10
+
11
+ These applications are Quarkus applications.
12
+ So you can run them in dev mode using ` mvn quarkus:dev ` , or package them using ` mvn package ` .
13
+ To run the package, you need to package them, and then run them using: ` java -jar target/quarkus-app/quarkus-run.jar `
14
+
15
+ The benchmark use ` wrk ` (https://github.com/wg/wrk ):
16
+
17
+ ``` shell
18
+ > wrk -t 10 -c50 -d40s http://localhost:8080/hello
19
+ ```
Original file line number Diff line number Diff line change
1
+ # Chapter 9 - Accessing Data Reactively
2
+
3
+ This directory contains the code from the _ Chapter 9 - Accessing Data Reactively_ :
4
+
5
+ * [ Hibernate Reactive] ( ./hibernate-reactive )
6
+ * [ Redis] ( ./redis )
7
+ * [ CDC with Debezium] ( ./debezium )
Original file line number Diff line number Diff line change @@ -41,10 +41,10 @@ docker exec -ti kafka bin/kafka-topics.sh --list --zookeeper zookeeper:2181
41
41
42
42
``` shell
43
43
docker-compose exec kafka /kafka/bin/kafka-console-consumer.sh \
44
- --bootstrap-server kafka:9092 \
45
- --from-beginning \
46
- --property print.key=true \
47
- --topic quarkus-db-server.public.customer
44
+ --bootstrap-server kafka:9092 \
45
+ --from-beginning \
46
+ --property print.key=true \
47
+ --topic quarkus-db-server.public.customer
48
48
```
49
49
50
50
Upon starting, four messages will be processed representing the four customers that were loaded
Original file line number Diff line number Diff line change 16
16
<maven .compiler.target>11</maven .compiler.target>
17
17
<project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
18
18
<project .reporting.outputEncoding>UTF-8</project .reporting.outputEncoding>
19
- <quarkus-plugin .version>2.1.0 .Final</quarkus-plugin .version>
19
+ <quarkus-plugin .version>2.4.1 .Final</quarkus-plugin .version>
20
20
<quarkus .platform.artifact-id>quarkus-bom</quarkus .platform.artifact-id>
21
21
<quarkus .platform.group-id>io.quarkus</quarkus .platform.group-id>
22
- <quarkus .platform.version>2.1.0 .Final</quarkus .platform.version>
22
+ <quarkus .platform.version>2.4.1 .Final</quarkus .platform.version>
23
23
<surefire-plugin .version>3.0.0-M5</surefire-plugin .version>
24
24
</properties >
25
25
<dependencyManagement >
Original file line number Diff line number Diff line change 1
- # PostgreSQL database
1
+ # Hibernate Reactive Example
2
2
3
- Before starting the Quarkus application, start a PostgreSQL instance in Docker:
3
+ This module is a simple reactive application using Quarkus and Hibernate Reactive.
4
+
5
+ ## Dev
6
+
7
+ You can run this application in dev mode using:
8
+
9
+ ``` shell
10
+ > mvn quarkus:dev
11
+ ```
12
+
13
+ The application is exposed on ` http://localhost:8080/customer ` .
14
+
15
+ ## Build
16
+
17
+ Build it the application package using:
18
+
19
+ ``` shell
20
+ > mvn clean package
21
+ ```
22
+
23
+ The output is located in ` target/quarkus-app `
24
+
25
+ ## Run
26
+
27
+ Once packaged, you can run the application with:
28
+
29
+ ``` shell
30
+ > java -jar target/quarkus-app/quarkus-run.jar
31
+ ```
32
+
33
+ In production mode, you need to start a PostgreSQL instance in Docker.
34
+ You can create one using:
4
35
5
36
``` shell
6
37
docker run --ulimit memlock=-1:-1 -it --rm=true --memory-swappiness=0 --name quarkus_test -e POSTGRES_USER=quarkus_test -e POSTGRES_PASSWORD=quarkus_test -e POSTGRES_DB=quarkus_test -p 5432:5432 postgres:13.2
Original file line number Diff line number Diff line change 16
16
<maven .compiler.target>11</maven .compiler.target>
17
17
<project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
18
18
<project .reporting.outputEncoding>UTF-8</project .reporting.outputEncoding>
19
- <quarkus-plugin .version>2.1.0 .Final</quarkus-plugin .version>
19
+ <quarkus-plugin .version>2.4.1 .Final</quarkus-plugin .version>
20
20
<quarkus .platform.artifact-id>quarkus-bom</quarkus .platform.artifact-id>
21
21
<quarkus .platform.group-id>io.quarkus</quarkus .platform.group-id>
22
- <quarkus .platform.version>2.1.0 .Final</quarkus .platform.version>
22
+ <quarkus .platform.version>2.4.1 .Final</quarkus .platform.version>
23
23
<surefire-plugin .version>3.0.0-M5</surefire-plugin .version>
24
24
</properties >
25
25
<dependencyManagement >
Original file line number Diff line number Diff line change
1
+ # REdis Example
2
+
3
+ This module is a simple reactive application using Quarkus and Redis.
4
+
5
+ ## Dev
6
+
7
+ You can run this application in dev mode using:
8
+
9
+ ``` shell
10
+ > mvn quarkus:dev
11
+ ```
12
+
13
+ The application is exposed on ` http://localhost:8080/customer ` .
14
+
15
+ ## Build
16
+
17
+ Build it the application package using:
18
+
19
+ ``` shell
20
+ > mvn clean package
21
+ ```
22
+
23
+ The output is located in ` target/quarkus-app `
24
+
25
+ ## Run
26
+
27
+ Once packaged, you can run the application with:
28
+
29
+ ``` shell
30
+ > java -jar target/quarkus-app/quarkus-run.jar
31
+ ```
32
+
33
+ In production mode, you need to start a Redis instance in Docker.
34
+ You can create one using:
35
+
36
+ ``` shell
37
+ docker run --ulimit memlock=-1:-1 -it --rm=true --memory-swappiness=0 --name redis_quarkus_test -p 6379:6379 redis:5.0.6
38
+ ```
Original file line number Diff line number Diff line change 16
16
<maven .compiler.target>11</maven .compiler.target>
17
17
<project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
18
18
<project .reporting.outputEncoding>UTF-8</project .reporting.outputEncoding>
19
- <quarkus-plugin .version>2.1.0 .Final</quarkus-plugin .version>
19
+ <quarkus-plugin .version>2.4.1 .Final</quarkus-plugin .version>
20
20
<quarkus .platform.artifact-id>quarkus-bom</quarkus .platform.artifact-id>
21
21
<quarkus .platform.group-id>io.quarkus</quarkus .platform.group-id>
22
- <quarkus .platform.version>2.1.0 .Final</quarkus .platform.version>
22
+ <quarkus .platform.version>2.4.1 .Final</quarkus .platform.version>
23
23
<surefire-plugin .version>3.0.0-M5</surefire-plugin .version>
24
24
25
25
<docker-plugin .version>0.28.0</docker-plugin .version>
Original file line number Diff line number Diff line change 1
- quarkus.redis.hosts =redis://localhost:6379
1
+ % prod. quarkus.redis.hosts =redis://localhost:6379
You can’t perform that action at this time.
0 commit comments