
Reactive Systems in Java: Resilient, Event-Driven Architecture with Quarkus
- Length: 250 pages
- Edition: 1
- Language: English
- Publisher: O'Reilly Media
- Publication Date: 2022-01-18
- ISBN-10: 1492091723
- ISBN-13: 9781492091721
- Sales Rank: #24684529 (See Top 100 Books)
Reactive systems and event-driven architecture are becoming essential to application design–and companies are taking note. Reactive systems ensure applications are responsive, resilient, and elastic no matter what failures, latency, or other errors may be occurring, while event-driven architecture offers a flexible and composable option for distributed systems. This practical resource helps you bring these approaches together using Quarkus, a Java framework that greatly simplifies the work developers must undertake for cloud deployments. This book covers how Quarkus 2.0 reactive features allow the smooth development of reactive systems.
Clement Escoffier and Ken Finnigan from Red Hat show you how to take advantage of event-driven and reactive principles to build more robust distributed systems, reducing latency and increasing throughput, particularly in your microservices and serverless applications. Java developers will also get a foundation in Quarkus, enabling you to create truly Kubernetes-native applications for the cloud.
- Understand the fundamentals of reactive systems and event-driven architecture
- Learn how to use Quarkus to build reactive applications
- Combine Quarkus with Apache Kafka or AMQP to build reactive systems
- Develop microservices that utilize messages with Quarkus for use in event-driven architectures
Preface Who Should Read This Book? What About Quarkus? Navigating This Book Getting You Ready Conventions Used in This Book O’Reilly Online Learning How to Contact Us Acknowledgments I. Reactive and Quarkus Introduction 1. Reactive in a Nutshell What Do We Mean by Reactive? Reactive Software Is Not New The Reactive Landscape Why Are Reactive Architectures So Well-Suited for Cloud Native Applications? Reactive Is Not a Silver Bullet 2. Introduction to Quarkus Java on the Cloud Thorntail Example Quarkus Example The Quarkus Way Create Your First Quarkus Application Kubernetes with Quarkus in 10 Minutes Going Native Summary II. Reactive and Event-Driven Applications 3. The Dark Side of Distributed Systems What’s a Distributed System? The New Kids on the Block: Cloud Native and Kubernetes Native Applications The Dark Side of Distributed Systems Fallacies of Distributed Computing in a Kubernetes World A Question of Timing: The Synchronous Communication Drawback Summary 4. Design Principles of Reactive Systems Reactive Systems 101 Commands and Events Commands Events Messages Commands Versus Events: An Example Destinations and Space Decoupling Time Decoupling The Role of Nonblocking Input/Output Blocking Network I/O, Threads, and Concurrency How Does Nonblocking I/O Work? Reactor Pattern and Event Loop Anatomy of Reactive Applications Summary 5. Reactive Programming: Taming the Asynchronicity Asynchronous Code and Patterns Using Futures Project Loom: Virtual Threads and Carrier Threads Reactive Programming Streams Operators Reactive Programming Libraries Reactive Streams and the Need for Flow Control Buffering Items Dropping Items What Is Backpressure? Introducing Reactive Streams Be Warned: It’s a Trap! Backpressure in Distributed Systems Summary III. Building Reactive Applications and Systems with Quarkus 6. Quarkus: Reactive Engine The Imperative Model The Reactive Model Unification of Reactive and Imperative A Reactive Engine A Reactive Programming Model Event-Driven Architecture with Quarkus Summary 7. Mutiny: An Event-Driven Reactive Programming API Why Another Reactive Programming Library? What Makes Mutiny Unique? Mutiny Usage in Quarkus Uni and Multi Mutiny and Flow Control Observing Events Transforming Events Chaining Asynchronous Actions Recovering from Failure Combining and Joining Items Selecting Items Collecting Items Summary 8. HTTP with Reactive in Mind The Journey of an HTTP Request Say Hello to RESTEasy Reactive! What’s the Benefit? Asynchronous Endpoints Returning Uni Dealing with Failure and Customizing the Response Streaming Data Raw Streaming Streaming JSON Array Using Server-Sent-Events Reactive Score Summary 9. Accessing Data Reactively The Problem with Data Access Nonblocking Interactions with Relational Databases Using a Reactive ORM: Hibernate Reactive What About NoSQL? Interacting with Redis Data-Related Events and Change Data Capture Using Debezium to Capture Change Summary IV. Connecting the Dots 10. Reactive Messaging: The Connective Tissue From Reactive Applications to Reactive Systems Channels and Messages Producing Messages Consuming Messages Processing Messages Acknowledgments Connectors Building Message-Based Applications Message and Acknowledgment Failures and Negative Acknowledgment Stream Manipulation Blocking Processing Retrying Processing Putting Everything Together Summary 11. The Event Bus: The Backbone Kafka or AMQP: Picking the Right Tool Building Reactive Systems with Kafka Apache Kafka Point-to-Point Communication Publish/Subscribe Elasticity Patterns Dealing with Failures Backpressure and Performance Considerations Kafka on Kubernetes Building Reactive Systems with AMQP AMQP 1.0 Point-to-Point Communication Publish/Subscribe Elasticity Patterns Acknowledgment and Redelivery Credit-Flow Backpressure Protocol AMQP on Kubernetes Summary 12. Reactive REST Client: Connecting with HTTP Endpoints Interacting with an HTTP Endpoint The REST Client Reactive Mapping HTTP APIs to Java Interfaces Invoking the Service Blocking and Nonblocking Handling Failures Fallback Retries Time-out Bulkheads and Circuit Breaker Building API Gateways with the RESTEasy Reactive Client Using the REST Client in Messaging Applications Summary 13. Observing Reactive and Event-Driven Architectures Why Is Observability Important? Health with Messaging Metrics with Messaging Distributed Tracing with Messaging Summary Conclusion A Brief Summary Is That All? The Future of Reactive Systems The End of the Beginning Index
How to download source code?
1. Go to: https://www.oreilly.com/
2. Search the book title: Reactive Systems in Java: Resilient, Event-Driven Architecture with Quarkus
, sometime you may not get the results, please search the main title
3. Click the book title in the search results
3. Publisher resources
section, click Download Example Code
.
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.