Share E-Book
Scan to open this page

Scan with your phone to open this page

AuthorAlex Soto Bueno & Jason Porter [Alex Soto Bueno]

Optimized for Kubernetes, Quarkus is designed to help you create Java applications that are cloud first, container native, and serverless capable. With this cookbook, authors Alex Soto Bueno and Jason Porter from Red Hat provide detailed solutions for installing, interacting with, and using Quarkus in the development and production of microservices. The recipes in this book show midlevel to senior developers familiar with Java enterprise application development how to get started with Quarkus quickly. You’ll become familiar with how Quarkus works within the wider Java ecosystem and discover ways to adapt this framework to your particular needs. You’ll learn how to: Shorten the development cycle by enabling live reloading in dev mode Connect to and communicate with Kafka Develop with the reactive programming model Easily add fault tolerance to your services Build your application as a Kubernetes-ready container Ease development with OpenAPI and test a native Quarkus application

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A recipe-driven field guide to building cloud-native Java microservices with Quarkus, covering everything from project scaffolding to Kubernetes deployment. Best suited for mid-level to senior Java enterprise developers who already know the ecosystem and want to move fast. 【Book Arc】 - **Opening (~0%–12%)**: Establishes Quarkus's positioning as a Kubernetes-optimized, container-first Java framework and walks through project scaffolding with Maven and Gradle, including IDE integration and extension management. - **Early (~12%–32%)**: Covers the development inner loop — configuration (properties and YAML), logging, custom config sources, Bean Validation, and the dev-mode live reload cycle that shortens iteration time. - **Early–Middle (~28%–36%)**: Introduces testing strategies, including `@QuarkusTest`, test resources, and native image testing, then transitions into persistence with Hibernate ORM, Panache entities, repositories, and multi-datasource setups. - **Middle (~36%–52%)**: Moves into production concerns — fault tolerance (bulkheads, retries), observability (health checks, metrics, distributed tracing via OpenTracing), and container image building with Jib and Docker. - **Late (~52%+)**: Addresses Kubernetes deployment specifics — probes, ConfigMaps, and configuring applications from within the cluster. (Excerpts do not cover chapters beyond this point in detail.) 【Key Takeaways】 - **Quarkus is designed for the container era** (Opening): Unlike traditional Java frameworks retrofitted for containers, Quarkus is built cloud-first, container-native, and serverless-capable from the ground up — this shapes every design decision in the book. - **Dev mode with live reload is the core productivity lever** (Early): The `quarkus:dev` workflow eliminates the build-deploy-test cycle, letting you see code changes reflected immediately — this is the single biggest day-to-day win for developers. - **Configuration is flexible and layered** (Early): Quarkus supports properties files, YAML (via the `config-yaml` extension), custom `ConfigSource` implementations registered via Java SPI, and Bean Validation constraints on config values — giving you fine-grained control over how the app is wired. - **Testing spans JVM and native modes** (Early–Middle): `@QuarkusTest` runs tests against the JVM, while `@NativeImageTest` runs the same tests against a compiled native executable — you can share test logic across both modes with inheritance. - **Panache simplifies persistence without locking you in** (Middle): You can use the active-record pattern with `PanacheEntity`, the repository pattern with `PanacheRepository`, or plain DAO — Quarkus doesn't force a single approach. Entities in external JARs need an empty `META-INF/beans.xml` to be indexed. - **Fault tolerance is annotation-driven** (Middle): MicroProfile Fault Tolerance annotations like `@Bulkhead` let you limit concurrent executions and throw `BulkheadException` when limits are hit — resilience becomes a declarative concern rather than boilerplate code. - **Observability is a first-class concern** (Middle): Health checks, metrics (via SmallRye Metrics with `/metrics`, `/metrics/vendor`, `/metrics/application` endpoints), and distributed tracing (OpenTracing with spans, baggage, tags) are all integrated natively. - **Kubernetes deployment is streamlined** (Middle–Late): Quarkus supports Jib (daemonless, cache-friendly) and Docker for image building, and generates Kubernetes manifests with liveness/readiness probes wired to MicroProfile Health endpoints. 【Reading Tips】 - **Skim the scaffolding chapters if you're experienced**: The Maven/Gradle setup recipes (Opening) are useful for reference but can be skimmed if you already know Quarkus or similar frameworks. - **Deep-read the testing and persistence chapters**: The testing recipes (Early–Middle) and Panache patterns (Middle) are where the most reusable, non-obvious knowledge lives — especially the native image testing setup and the external JAR entity gotcha. - **Treat fault tolerance and observability as a unit**: Read them together (Middle) since they're both about production readiness — the annotations and endpoints complement each other. - **Don't skip the Kubernetes chapter**: Even if you're not deploying yet, the probe configuration and ConfigMap recipes (Late) show how Quarkus integrates with the platform it was designed for. - **Use the book as a reference, not a novel**: This is a cookbook — jump to the recipe you need rather than reading linearly, especially for configuration and deployment topics. 【Coverage Limits】 The excerpts cover roughly the first half of the book in detail, with the later chapters (Kubernetes deployment and beyond) only partially represented. Specific recipes on reactive programming, Kafka integration, and OpenAPI — mentioned in the blurb — are not covered in the available excerpts.
Excerpt 1
re information, visit http://oreilly.com. How to Contact Us Please address comments and questions concerning this book to the publisher: O’Reilly Media, Inc....
View in text
Excerpt 2
uage":"python"}' \ -H "Content-Type: application/json" -X POST http://localhost:8080/developer -v < HTTP/1.1 400 Bad Request < Content-Length: 89 < validatio...
View in text
Excerpt 3
ct with the native profile enabled: ./mvnw package -Pnative After a few minutes, a native executable will be present in target directory: [INFO] --- quarkus-...
View in text
Excerpt 4
ollowing page on GitHub: Metrics for Eclipse MicroProfile 9.4 Creating Metrics Problem You want to monitor some custom metrics, such as performance metrics o...
View in text
Excerpt 5
ceDoneable(HelloResource resource, Function<HelloResource, HelloResource> function) { super(resource, function); } } spec: selector: matchLabels: app: quarku...
View in text
Excerpt 6
sponse.class); System.out.println(responseWorldClock.getStatus()); System.out.println(responseWorldClock.getStringHeaders()); // ... more methods return resp...
View in text
Excerpt 7
, visit the following websites: Apache Kafka: Kafka Streams Confluent: kafkacat Utility 15.8 Using AMQP with Quarkus Problem You want to use AMQP (Advanced M...
View in text
Excerpt 8
on Quartz, Solution query, using Reactive SQL, Problem Qute changing location for templates, Problem creating templates with, Problem extending data classes,...
View in text
Tags
AI categories
JavaCloud NativeBackend
Publish Year: 2020
Language: English
File Format: PDF
File Size: 8.0 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…