Skip to content

Commit 1d982e0

Browse files
committed
Add instructions for the chapter 8 and 9.
1 parent e5a111d commit 1d982e0

File tree

13 files changed

+202
-13
lines changed

13 files changed

+202
-13
lines changed

chapter-8/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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 numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
```

chapter-8/reactive-scores/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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 numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
```

chapter-8/simple-benchmark/README.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
```

chapter-9/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
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)

chapter-9/debezium/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ docker exec -ti kafka bin/kafka-topics.sh --list --zookeeper zookeeper:2181
4141

4242
```shell
4343
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
4848
```
4949

5050
Upon starting, four messages will be processed representing the four customers that were loaded

chapter-9/debezium/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
<maven.compiler.target>11</maven.compiler.target>
1717
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1818
<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>
2020
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
2121
<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>
2323
<surefire-plugin.version>3.0.0-M5</surefire-plugin.version>
2424
</properties>
2525
<dependencyManagement>

chapter-9/hibernate-reactive/README.md

+33-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,37 @@
1-
# PostgreSQL database
1+
# Hibernate Reactive Example
22

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:
435

536
```shell
637
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

chapter-9/hibernate-reactive/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
<maven.compiler.target>11</maven.compiler.target>
1717
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1818
<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>
2020
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
2121
<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>
2323
<surefire-plugin.version>3.0.0-M5</surefire-plugin.version>
2424
</properties>
2525
<dependencyManagement>

chapter-9/redis/README.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
```

chapter-9/redis/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
<maven.compiler.target>11</maven.compiler.target>
1717
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1818
<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>
2020
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
2121
<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>
2323
<surefire-plugin.version>3.0.0-M5</surefire-plugin.version>
2424

2525
<docker-plugin.version>0.28.0</docker-plugin.version>
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
quarkus.redis.hosts=redis://localhost:6379
1+
%prod.quarkus.redis.hosts=redis://localhost:6379

0 commit comments

Comments
 (0)