Skip to content

Commit 0a7e10d

Browse files
committed
Add READMEs for individual chapters
1 parent 0f36b65 commit 0a7e10d

File tree

18 files changed

+238
-13
lines changed

18 files changed

+238
-13
lines changed

README.adoc

+27-13
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,15 @@
22

33
This repository represents the book code developed in the book link:https://www.manning.com/books/quarkus-in-action[Quarkus in Action] released in January 2025.
44

5-
Free online e-book version - https://developers.redhat.com/e-books/quarkus-action
6-
Printed version can be baught here - http://mng.bz/7vl7
5+
*Free online e-book version - https://developers.redhat.com/e-books/quarkus-action*
6+
7+
*Printed version can be bought here - http://mng.bz/7vl7*
8+
9+
++++
10+
<p align="center">
11+
<img width="300" src="images/book-cover.png">
12+
</p>
13+
++++
714

815
---
916

@@ -13,17 +20,17 @@ _Available in_: link:README.adoc[English]
1320

1421
Folders in this repository correspond to the individual chapters in the book. The commit history contains the step by step implementations added per section of the book.
1522

16-
- link:chapter-02/README.adoc[Chapter 2: Your first Quarkus application]
17-
- link:chapter-03/README.adoc[Chapter 3: Enhancing developer productivity with Quarkus]
18-
- link:chapter-04/README.adoc[Chapter 4: Handling communications]
19-
- link:chapter-05/README.adoc[Chapter 5: Testing Quarkus applications]
20-
- link:chapter-06/README.adoc[Chapter 6: Exposing and securing web applications]
21-
- link:chapter-07/README.adoc[Chapter 7: Database access]
22-
- link:chapter-08/README.adoc[Chapter 8: Reactive programming]
23-
- link:chapter-09/README.adoc[Chapter 9: Quarkus messaging]
24-
- link:chapter-10/README.adoc[Chapter 10: Cloud-native application patterns]
25-
- link:chapter-11/README.adoc[Chapter 11: Quarkus applications in the cloud]
26-
- link:chapter-12/README.adoc[Chapter 12: Custom Quarkus extensions]
23+
- link:chapter-02[Chapter 2: Your first Quarkus application]
24+
- link:chapter-03[Chapter 3: Enhancing developer productivity with Quarkus]
25+
- link:chapter-04[Chapter 4: Handling communications]
26+
- link:chapter-05[Chapter 5: Testing Quarkus applications]
27+
- link:chapter-06[Chapter 6: Exposing and securing web applications]
28+
- link:chapter-07[Chapter 7: Database access]
29+
- link:chapter-08[Chapter 8: Reactive programming]
30+
- link:chapter-09[Chapter 9: Quarkus messaging]
31+
- link:chapter-10[Chapter 10: Cloud-native application patterns]
32+
- link:chapter-11[Chapter 11: Quarkus applications in the cloud]
33+
- link:chapter-12[Chapter 12: Custom Quarkus extensions]
2734

2835
The root link:acme-car-rental[acme-car-rental] directory contains the full Car Rental application that you start building from Chapter 4. Everything can be built from source. Feel free to experiment with this codebase as you find fit.
2936

@@ -42,3 +49,10 @@ Jan Martiska
4249

4350
- X - link:https://twitter.com/janmartiska[@janmartiska]
4451
- LinkedIn - https://www.linkedin.com/in/janmartiska/
52+
53+
++++
54+
<p align="center">
55+
<img width="460" src="images/authors.jpeg">
56+
</p>
57+
++++
58+

chapter-02/README.adoc

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
= Quarkus in Action Chapter 02 - Your first Quarkus application
2+
3+
_Available in_: link:README.adoc[English]
4+
5+
---
6+
7+
In this first coding chapter, we will learn how you can start working with Quarkus. You will learn how you can generate Quarkus application in three different ways:
8+
9+
- Quarkus Maven plugin
10+
- Quarkus CLI
11+
- Quarkus generator site (code.quarkus.io)
12+
13+
All subsections in this directory container the same starting quarkus-in-action application that we use to explain the Quarkus project structure and how you can run Quarkus applications. You can compile all the applications to GraalVM native with the `-Pnative` flag.
14+
15+
[source,bash]
16+
----
17+
__ ____ __ _____ ___ __ ____ ______
18+
--/ __ \/ / / / _ | / _ \/ //_/ / / / __/
19+
-/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \
20+
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/
21+
2025-02-12 10:24:10,817 INFO [io.quarkus] (Quarkus Main Thread) quarkus-in-action 1.0.0-SNAPSHOT on JVM (powered by Quarkus 3.15.1) started in 1.279s. Listening on: http://localhost:8080
22+
23+
2025-02-12 10:24:10,819 INFO [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
24+
2025-02-12 10:24:10,820 INFO [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, rest, smallrye-context-propagation, vertx]
25+
----
26+

chapter-03/README.adoc

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
= Quarkus in Action Chapter 03 - Enhancing developer productivity with Quarkus
2+
3+
_Available in_: link:README.adoc[English]
4+
5+
---
6+
7+
This chapter explores various different productivity enhancements included in the Quarkus's Dev mode. You can start dev mode with `./mvnw quarkus:dev` (maven) or `quarkus dev` (CLI):
8+
9+
[source,bash]
10+
----
11+
__ ____ __ _____ ___ __ ____ ______
12+
--/ __ \/ / / / _ | / _ \/ //_/ / / / __/
13+
-/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \
14+
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/
15+
2025-02-12 10:27:36,431 INFO [io.quarkus] (Quarkus Main Thread) quarkus-in-action 1.0.0-SNAPSHOT on JVM (powered by Quarkus 3.15.1) started in 1.257s. Listening on: http://localhost:8080
16+
17+
2025-02-12 10:27:36,433 INFO [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
18+
2025-02-12 10:27:36,433 INFO [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, rest, smallrye-context-propagation, vertx]
19+
----
20+
21+
The Dev mode is interactive, just press `h` key to see the options.
22+
23+
Dev UI can be opened at `http://localhost:8080/q/dev-ui` or by simply pressing `d` in the Dev mode terminal.
24+
25+
Continuous testing can be started by pressing `r` in the Dev mode terminal.
26+

chapter-04/README.adoc

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
= Quarkus in Action Chapter 04 - Handling communications
2+
3+
_Available in_: link:README.adoc[English]
4+
5+
---
6+
7+
Chapter 04 is the first chapter where we start creating our Acme Car Rental application. We start by creating first three services:
8+
9+
- Reservation service in section link:4_2[4.2 Car rental Reservation service]
10+
- Rental service in section link:4_3[4.3 Usint the REST client]
11+
- Inventory service in section link:4_5_1[4.5.1 Exposing the Inventory service over GraphQL]
12+
13+
Additionally, we also create an Inventory CLI application that demostrates the gRPC client capabilities in Quarkus:
14+
15+
- Inventory CLI in section link:4_8_2[4.8.2 Using a gRPC client with Quarkus]
16+
17+
The final Acme Car Rental version after this chapter looks like this:
18+
19+
++++
20+
<p align="center">
21+
<img width="80%" src="../images/04-final-arch.png">
22+
</p>
23+
++++
24+
25+

chapter-05/README.adoc

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
= Quarkus in Action Chapter 05 - Testing Quarkus applications
2+
3+
_Available in_: link:README.adoc[English]
4+
5+
---
6+
7+
Chapter 05 builds on top of the Reservation service we built in Chapter 04 and showcases various test scenarios, including:
8+
9+
- Simple unit tests - link:5_1_1[5.1.1 Writing a simple test for the Reservation repository]
10+
- Native tests - link:5_2_1[5.2.1 Writing a test for the Reservation resource]
11+
- Mocking with CDI alternatives - link:5_3_1[5.3.1 Mocking by replacing implementations]
12+
- Mocking with Mockito = link:5_3_2[5.3.2 Mocking with Mockito]
13+
14+
After this chapter, you will have the following test available in the Reservation service:
15+
16+
[source,bash]
17+
----
18+
$ tree reservation-service/src/test/java
19+
reservation-service/src/test/java
20+
└── org
21+
└── acme
22+
└── reservation
23+
├── ReservationRepositoryTest.java
24+
├── ReservationResourceIT.java
25+
└── ReservationResourceTest.java
26+
----
27+
28+

chapter-06/README.adoc

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
= Quarkus in Action Chapter 06 - Exposing and securing web applications
2+
3+
_Available in_: link:README.adoc[English]
4+
5+
---
6+
7+
This chapter moves to the front end side of development. We create our next car rental service call the Users service in link:6_1[6.1 Creating a secured web application] section. You will also learn how to use a Keycloak instance (automatically started and managed through Dev Services) to authenticate your users with very little configuration. Lastly, you will also deploy a very simple production version of Keycloak using containers (Docker or Podman) in link:production[6.4.1 Running Keycloak and PostgreSQL as container] and learn how to set up your applications (Users service and Reservation service) to connect to it in link:6_4_2[6.4.2 Wiring the services to use Keycloak].
8+
9+
The final version of the application after this chapter looks like this:
10+
11+
12+
++++
13+
<p align="center">
14+
<img width="80%" src="../images/06-final-arch.png">
15+
</p>
16+
++++
17+
18+

chapter-07/README.adoc

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
= Quarkus in Action Chapter 07 - Database access
2+
3+
_Available in_: link:README.adoc[English]
4+
5+
---
6+
7+
Right after the frontend part, we jump straight to the other side -- databases. Quarkus provides a plethora of different options for databases ranging from direct JDBC and traditional JPA (Hibernate ORM) to newly defined Panache library that also comes from the very same Hibernate team and greatly simplifies the ORM development in Quarkus. Which is also why we focus on it in this chapter. You will learn about two different approaches -- active record pattern and the repository pattern. We will also look into the REST data extensions that allow us to generate REST CRUD resources for our entities. Next, we move to the NoSQL world and guess what? We will still use the same Panache API also there! Lastly, we will take a step in to the reactive world and show you how you access your databases in nonblocking way with Hibernate Reactive and its integration with Panache in Quarkus.
8+
9+
After we finish this chapter we will have the following databases setup in the respective services:
10+
11+
- PostgreSQL in the Reservation service (link:7_1_2[7.1.2 Getting started with Panache])
12+
- MySQL in the Inventory service (link:7_2_1[7.2.1 Utilizing repository pattern with MySQL])
13+
- MongoDB in the Rental service (link:7_6_1[7.6.1 Utilizing MongoDB with Panache])
14+
- PostgreSQL with Hibernate Reactive in the Reservation service (link:7_7_1[7.7.1 Using Hibernate Reactive with Panache])
15+

chapter-08/README.adoc

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
= Quarkus in Action Chapter 08 - Reactive programming
2+
3+
_Available in_: link:README.adoc[English]
4+
5+
---
6+
7+
The were a few places in the book so far where the learning journey took us into the reactive world. Especially, the last section in the previous chapter. Now is the time to embrace reactive programming and learn what it can bring into your applications. You will learn about the Mutiny library and its very simple API that we can utilize almost everywhere in Quarkus (link:8_2_2/mutiny-example[8.2.2 Mutiny API]). We will also look into whether you might need it or not. Reactive programming is of course a very discutable and opinionated topic, so no one is forced to use it. Since project Loom (virtual threads) became a finalized feature in JDK 21, you don't even have to learn reactive programming to get similar performance characteristics. However, there are still some problem with project Loom that we describe in link:8_5_1/loom-example[8.5.1 Project Loom in Quarkus]. The final choice of whether to use the reactive programming or project Loom or neither is however not restricted in any way. In Quarkus, you can mix and match all paradigms as you see fit. Even in the same class.
8+
9+
10+
This chapter prepares us for the inclusion of asynchronous massage passing in our Acme Car Rental application in the next chapter.
11+

chapter-09/README.adoc

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
= Quarkus in Action Chapter 09 - Quarkus messaging
2+
3+
_Available in_: link:README.adoc[English]
4+
5+
---
6+
7+
Scaling of synchronous communication protocols that we learned about in chapter 4 is restricted by the unreliable nature of networks (link:https://en.wikipedia.org/wiki/CAP_theorem[CAP theorem]). Which is why Quarkus provides you with a very simple integration of different messaging protocols based on the asynchronous message passing jointly called Quarkus messaging. Even if the integration is based on the MicroProfile Reactive Messaging specification (link:9_3_2/reactive-messaging-example[9.3.2 Reactive messaging API]) and its SmallRye Reactive Messaging implementation we use in Quarkus, users are not required to write reactive code to utilize asynchronous messaging. In this chapter, we will learn how to integrate our car rental services using two messaging providers -- Apache Kafka (link:9_6_1[9.6.1 Kafka integration in the Rental service]) and RabbitMQ (link:9_7[9.7 Quarkus messaging with RabbitMQ]). We will also create our final and purely reactive car rental service, the Billing service in link:9_8[9.8 Car Rental Billing service] that integrates both providers in a single service. You will see how Quarkus make all this development extremely easy with Dev Services that automatically share all providers between the relevant services.
8+
9+
After this chapter, we will have the following architecture:
10+
11+
12+
++++
13+
<p align="center">
14+
<img width="80%" src="../images/09-final-arch.png">
15+
</p>
16+
++++
17+

chapter-10/README.adoc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
= Quarkus in Action Chapter 10 - Cloud-native application patterns
2+
3+
_Available in_: link:README.adoc[English]
4+
5+
---
6+
7+
After the previous chapter we have all communication covered but if we are about to deploy our services to cloud platforms (Kubernetes or OpenShift), we should also prepare them for the various scenarios that they can hit there. These are jointly covered by a set of MicroProfile specifications. In this chapter, we will go over the main specifications and their SmallRye implementation used in Quarkus, to demonstrate how you can easily extend your services to provide for instance health checks (link:10_2_1[10.2.1 Monitoring the health of Car Rental]), metrics (link:10_3_6[10.3.6 Monitoring metrics of Car Rental]), observability (link:10_4_2[10.4.2 Adding tracing capabilities to Car Rental]), or fault tolerance of synchronous communication (link:10_5_1[10.5.1 Adding Fault Tolerance to Car Rental]). We will focus our development on the Inventory service but all of the demonstrated patterns can be applied to any of the other services too.
8+

chapter-11/README.adoc

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
= Quarkus in Action Chapter 11 - Quarkus applications in the cloud
2+
3+
_Available in_: link:README.adoc[English]
4+
5+
---
6+
7+
The time has come to put everything we developed so far together and deploy it in the production environment which in our case is the link:https://developers.redhat.com/developer-sandbox[Red Hat Openshift Sandbox]. Individual sections will take us gradually the full OpenShift deployment of Acme Car Rental in several steps:
8+
9+
1. Local development version with Dev Services (what we used so far) -- link:11_1[11.1 Car Rental production]
10+
2. Local production version with externalized providers -- link:11_1_1[11.1.1 Externalizing providers for independent deployment]
11+
3. Production version with deployed Docker/Podman images -- link:11_2_4[11.2.4 Pushing Car rental images to quay.io]
12+
4. Deploying single Quarkus application on Kubernetes -- link:11_3_3[11.3.3 Deploying Quarkus applications on Kubernetes]
13+
5. Deploying single Quarkus application on OpenShift -- link:11_3_4[11.3.4 Deploying Quarkus applications on OpenShift]
14+
6. Example of serverless deployment with Knative -- link:11_5_3[11.5.3 Car statistics application with Knative]
15+
7. Full Acme Car Rental deployment in OpenShift Sandbox -- link:11_6_3[11.6.3 Car rental services deployment with OpenShift Sandbox]
16+
17+
And after step 7, you will see a full Acme Car Rental in your OpenShift Sandbox instance!
18+
19+
20+
++++
21+
<p align="center">
22+
<img width="80%" src="../images/11-final.png">
23+
</p>
24+
++++
25+

chapter-12/README.adoc

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
= Quarkus in Action Chapter 12 - Custom Quarkus extensions
2+
3+
_Available in_: link:README.adoc[English]
4+
5+
---
6+
7+
The last chapter of this book focuses on the extension development. This is not and easy task, but it nicely puts the concepts explained in the book into perspective since you will be able to directly see how the individual pieces of Quarkus's magic set in place. We will develop a small informative extension called "metadata" that outputs some metadata about your Quarkus application. We will how you bootstrap an extension project in link:12_3_1[12.3.1 Creating the project]. Then we explore various pieces of extension development like addition of custom configuration (link:12_3_2[12.3.2 Extending the configuration model]), exposing HTTP interface (link:12_3_3[12.3.3 Creating the HTTP handler]), or creating a recorder object that records the bytecode that can be replayed during runtime (link:12_3_4[12.3.4 Creating the recorder]). Later, we put everything together in the processor class (link:12_3_5[12.3.5 Creating the processor]). For completeness, we finish Quarkus in Action with a few tests for our newly created extension.
8+
9+
Congratulations! You've got to the end of the book. Hopefully, you found the presented content valuable and helpful. Thank you for reading our book!
10+
11+
image:../images/book-cover.png[]
12+

images/04-final-arch.png

204 KB
Loading

images/06-final-arch.png

275 KB
Loading

images/09-final-arch.png

328 KB
Loading

images/11-final.png

1.27 MB
Loading

images/authors.jpeg

291 KB
Loading

images/book-cover.png

2.45 MB
Loading

0 commit comments

Comments
 (0)