Book description
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
Publisher resources
Table of contents
- Foreword
- Preface
- 1. Quarkus Overview
- 2. Scaffolding
- 3. Developing RESTful Services
-
4. Configuration
- 4.1. Configuring the Application with Custom Properties
- 4.2. Accessing Configuration Properties Programmatically
- 4.3. Overwriting Configuration Values Externally
- 4.4. Configuring with Profiles
- 4.5. Changing Logger Configuration
- 4.6. Adding Application Logs
- 4.7. Advanced Logging
- 4.8. Configuring with Custom Profiles
- 4.9. Creating Custom Sources
- 4.10. Creating Custom Converters
- 4.11. Grouping Configuration Values
- 4.12. Validating Configuration Values
-
5. Programming Model
- 5.1. Marshalling/Unmarshalling JSON
- 5.2. Marshalling/Unmarshalling XML
- 5.3. Validating Input and Output Values
- 5.4. Creating Custom Validations
- 5.5. Validating Objects Programmatically
- 5.6. Injecting Dependencies
- 5.7. Creating Factories
- 5.8. Executing Object Life Cycle Events
- 5.9. Executing Application Life Cycle Events
- 5.10. Using a Named Qualifier
- 5.11. Using Custom Qualifiers
- 5.12. Qualifying and Configuring Annotations
- 5.13. Creating Interceptors
- 5.14. Writing Behavioral Tests
- 5.15. Writing Unit Tests
- 5.16. Creating Mock Objects
- 5.17. Creating Mock Objects with Mockito
- 5.18. Grouping Several Annotations into One with a Meta-Annotation
- 5.19. Executing Code Before or After a Test
- 5.20. Testing the Native Executable
- 6. Packaging Quarkus Applications
-
7. Persistence
- 7.1. Defining a Datasource
- 7.2. Using Multiple Datasources
- 7.3. Adding Datasource Health Check
- 7.4. Defining Transaction Boundaries Declaratively
- 7.5. Setting a Transaction Context
- 7.6. Programmatic Transaction Control
- 7.7. Setting and Modifying a Transaction Timeout
- 7.8. Setup with Persistence.xml
- 7.9. Setup Without persistence.xml
- 7.10. Using Entities from a Different JAR
- 7.11. Persisting Data with Panache
- 7.12. Finding All Entity Instances with Panache listAll Method
- 7.13. Finding Individual Entities with Panache findById Method
- 7.14. Finding Entities Using Panache Find and List Methods
- 7.15. Obtaining a Count of Entities Using the Panache count Method
- 7.16. Paginating Through Entity Lists Using the Panache page Method
- 7.17. Streaming Results via the Panache Stream Method
- 7.18. Testing Panache Entities
- 7.19. Using a Data Access Object (DAO) or Repository Pattern
- 7.20. Using Amazon DynamoDB
- 7.21. Working with MongoDB
- 7.22. Using Panache with MongoDB
- 7.23. Using Neo4j with Quarkus
- 7.24. Flyway at Startup
- 7.25. Using Flyway Programmatically
- 8. Fault Tolerance
- 9. Observability
-
10. Integrating with Kubernetes
- 10.1. Building and Pushing Container Images
- 10.2. Generating Kubernetes Resources
- 10.3. Generating Kubernetes Resources with Health Checks
- 10.4. Deploying Services on Kubernetes
- 10.5. Deploying Services on OpenShift
- 10.6. Building and Deploying a Container Image Automatically
- 10.7. Configuring an Application from Kubernetes
- 10.8. Configuring an Application from Kubernetes with Config Extension
- 10.9. Interacting with a Kubernetes Cluster Programmatically
- 10.10. Testing Kubernetes Client Interactions
- 10.11. Implementing a Kubernetes Operator
- 10.12. Deploying and Managing Serverless Workloads with Knative
-
11. Authentication and Authorization
- Quarkus Security Basics
- 11.1. Authentication and Authorization with Elytron Properties File Config
- 11.2. Authentication and Authorization with Elytron Security JDBC Config
- 11.3. Authorization with MicroProfile JWT
- 11.4. Authorization and Authentication with OpenId Connect
- 11.5. Protecting Web Resources with OpenId Connect
- 12. Application Secrets Management
- 13. Quarkus REST Clients
- 14. Developing Quarkus Applications Using Spring APIs
-
15. Working with a Reactive
Programming Model
- 15.1. Creating Async HTTP Endpoints
- 15.2. Streaming Data Asynchronously
- 15.3. Using Messaging to Decouple Components
- 15.4. Reacting to Apache Kafka Messages
- 15.5. Sending Messages to Apache Kafka
- 15.6. Marshalling POJOs into/out of Kafka
- 15.7. Using Kafka Streams API
- 15.8. Using AMQP with Quarkus
- 15.9. Using MQTT
- 15.10. Query Using Reactive SQL
- 15.11. Insert Using Reactive SQL Client
- 15.12. Using the Reactive MongoDB Client
- 15.13. Using the Reactive Neo4j Client
-
16. Additional Quarkus Features
- 16.1. Creating Templates with the Qute Template Engine
- 16.2. Rending HTML Using Qute
- 16.3. Changing the Location of Qute Templates
- 16.4. Extending Qute Data Classes
- 16.5. Describing Endpoints with OpenAPI
- 16.6. Customizing OpenAPI Spec
- 16.7. Sending Email Synchronously
- 16.8. Sending Email Reactively
- 16.9. Creating Scheduled Jobs
- 16.10. Using Application Data Caching
- Minikube
- Keycloak
- Knative
- Index
Product information
- Title: Quarkus Cookbook
- Author(s):
- Release date: July 2020
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781492062653
You might also like
book
Istio in Action
Solve difficult service-to-service communication challenges around security, observability, routing, and resilience with an Istio-based service mesh. …
book
Vert.x in Action
As enterprise applications become larger and more distributed, new architectural approaches like reactive designs, microservices, and …
book
gRPC: Up and Running
Get a comprehensive understanding of gRPC fundamentals through real-world examples. With this practical guide, you’ll learn …
book
Learning Go
Go is rapidly becoming the preferred language for building web services. While there are plenty of …