0%

Book Description

Build robust and reliable Java applications that works on modern infrastructure, such as containers and cloud, using the new features in Quarkus 1.0

Key Features

  • Build apps with faster boot time and low RSS memory using the latest Quarkus 1.0 features
  • Seamlessly integrate imperative and reactive programming models to build modern Java applications
  • Discover effective solutions for running Java on serverless apps, microservices, containers, FaaS, and the cloud

Book Description

Quarkus is a new Kubernetes-native framework that allows Java developers to combine the power of containers, microservices, and cloud-native to build reliable applications. The book is a development guide that will teach you how to build Java-native applications using Quarkus and GraalVM.

We start by learning about the basic concepts of a cloud-native application and its advantages over standard enterprise applications. Then we will quickly move on to application development, by installing the tooling required to build our first application on Quarkus. Next, we'll learn how to create a container-native image of our application and execute it in a Platform-as-a-Service environment such as Minishift. Later, we will build a complete real-world application that will use REST and the Contexts and Dependency injection stack with a web frontend. We will also learn how to add database persistence to our application using PostgreSQL. We will learn how to work with various APIs available to?Quarkus?such as Camel, Eclipse MicroProfile, and Spring DI. Towards the end, we will learn advanced development techniques such as securing applications, application configuration, and working with non-blocking programming models using Vert.x.

By the end of this book, you will be proficient with all the components of Quarkus and develop-blazing fast applications leveraging modern technology infrastructure.

What you will learn

  • Build a native application using Quarkus and GraalVM
  • Secure your applications using Elytron and the MicroProfile JWT extension
  • Manage data persistence with Quarkus using PostgreSQL
  • Use a non-blocking programming model with Quarkus
  • Learn how to get Camel and Infinispan working in native mode
  • Deploy an application in a Kubernetes-native environment using Minishift
  • Discover Reactive Programming with Vert.x

Who this book is for

The book is for Java developers and software architects?who are interested in learning a promising microservice architecture for building reliable and robust applications. Knowledge of Java, Spring Framework, and REST APIs is assumed.

Table of Contents

  1. Title Page
  2. Copyright and Credits
    1. Hands-On Cloud-Native Applications with Java and Quarkus
  3. Dedication
  4. About Packt
    1. Why subscribe?
  5. Foreword
  6. Contributors
    1. About the author
    2. About the reviewers
    3. Packt is searching for authors like you
  7. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Code in Action
      4. Conventions used
    4. Get in touch
      1. Reviews
  8. Section 1: Getting Started with Quarkus
  9. Introduction to Quarkus Core Concepts
    1. Technical requirements
    2. From the big data hype to Kubernetes
      1. The Kubernetes architecture in a nutshell
      2. Benefits of using Kubernetes
    3. From Java EE to MicroProfile
      1. The Twelve-Factor App methodology
      2. The MicroProfile initiative
    4. Quarkus – a Kubernetes-native Java framework
      1. Native code execution
      2. Container first
      3. Unifying the imperative and Reactive Programming models
      4. Coding that sparks joy
      5. Best-of-breed Java libraries and standards
    5. Quarkus architecture
    6. Getting started with GraalVM
      1. Installing GraalVM
      2. Running a Java application with GraalVM
        1. Building native images
    7. Installing a development environment
      1. A brief overview of IntelliJ IDEA
        1. Installing IntelliJ Plugin for Quarkus
    8. Summary
  10. Developing Your First Application with Quarkus
    1. Technical requirements
    2. Getting started with the Quarkus Maven plugin
      1. Launching the Quarkus Maven plugin
      2. Running the application
      3. Using the Maven plugin to generate a Gradle project
    3. Kick-starting applications using the Quarkus online application
    4. Testing live reload from your IDE
      1. Debugging applications
      2. Testing Quarkus applications
        1. Choosing a different port for testing
    5. Turning your application into a native executable
      1. Executing integration tests against the native executable
    6. Summary
  11. Creating a Container Image of Your Application
    1. Technical requirements
    2. Setting up Docker
    3. Running Quarkus applications in a container
      1. Running the native executable process in a container
    4. Deploying Quarkus applications on a Kubernetes-native platform
      1. Installing Minishift
      2. Building and deploying a Quarkus application on OKD
        1. Scaling our Quarkus service
    5. Summary
  12. Section 2: Building Applications with Quarkus
  13. Adding Web Interfaces to Quarkus Services
    1. Technical requirements
    2. Adding web content to Quarkus applications
      1. Building a CRUD application
        1. Adding a UI to our customer service
        2. Testing our application
        3. Running the example
        4. Running our application on Minishift
        5. Configuring Cross-Origin Resource Sharing in Quarkus
    3. Adding Enterprise web components
      1. Introducing WebSockets
      2. Building a project that uses Websockets
      3. Creating a WebSocket client project
        1. Adding an AJAX handler
    4. Summary
  14. Managing Data Persistence with Quarkus
    1. Technical requirements
    2. Adding an ORM layer to our applications
      1. Defining the entity layer
      2. Coding the repository classes
      3. Defining REST endpoints
      4. Connecting to the database
      5. Coding a test class
    3. Adding a web interface to our application
      1. Running the application
      2. Caching entity data
      3. Taking an application to the cloud
    4. Making data persistence easier using Panache API
    5. Summary
  15. Building Applications Using the MicroProfile API
    1. Technical requirements
    2. Getting started with the MicroProfile API
      1. Getting started with MicroProfile projects
    3. The Eclipse MicroProfile Health Check
      1. Using liveness and readiness checks
      2. Letting OpenShift manage unhealthy services
    4. The Eclipse MicroProfile Fault Tolerance API
      1. Using Timeout, Fallback, and Retry to create resilient services
        1. Applying a retry policy to your failures
      2. Circuit Breaker
      3. Using asynchronous and bulkhead policies
    5. The Eclipse MicroProfile Metrics API
    6. Configuring OpenAPI and the Swagger UI
      1. Customizing the output of OpenAPI
    7. The Eclipse MicroProfile OpenTracing API
    8. The Eclipse MicroProfile REST Client API
    9. Summary
  16. Securing Applications
    1. Technical requirements
    2. Securing our customer service
    3. Securing Quarkus services with Elytron
      1. Creating a test class that performs basic authentication
    4. Securing Quarkus services with Keycloak
      1. Adding a Keycloak extension to our service
      2. Setting up Keycloak
      3. Defining the security realm
      4. Configuring Quarkus for Keycloak
      5. Coding the test class
        1. Gathering principal and role information at runtime
    5. Securing Quarkus services with MicroProfile JWT
      1. Configuring our service to use JWT
      2. Running our test
        1. Injecting JWT claims and token information
    6. Using HTTPS with Quarkus
    7. Summary
  17. Section 3: Advanced Development Tactics
  18. Advanced Application Development
    1. Technical requirements
    2. Using advanced configuration options
      1. Multiple configuration sources
        1. Configuring custom configuration sources
      2. Using converters in your configuration
        1. Adding custom converters
      3. Testing advanced configuration options
    3. Configuration profiles
      1. Activating profiles
        1. Automatic profile selection
    4. Controlling the application life cycle
      1. Activating a database test resource
    5. Firing events with the Quarkus scheduler
      1. Using the cron scheduler format
      2. Firing one-time events
    6. Summary
  19. Unifying Imperative and Reactive with Vert.x
    1. Technical requirements
    2. Demystifying Reactive Programming and Vert.x
    3. Vert.x API models in Quarkus
      1. Managing the Vert.x core API
      2. Managing Vert.x API for RxJava
        1. Using RxJava with Quarkus
      3. Decoupling events with Vert.x axle libraries
        1. Adding an EventBus layer to Quarkus applications
        2. Rolling up the application
      4. Streaming SSE with Vert.x
        1. Canceling events
    4. Managing the Reactive SQL Client
      1. Configuring your application to use the PostgreSQL reactive client
      2. Running the example
    5. Summary
  20. Reactive Messaging with Quarkus
    1. Technical requirements
    2. Getting started with Reactive Messaging
    3. Streaming messages with Apache Kafka
      1. Composing our stock trading application
        1. Coding bean classes
      2. Streaming messages to Kafka in the cloud
        1. Installing Kafka on OpenShift
        2. Shaping up our project for native cloud execution
    4. Streaming messages with AMQP
      1. Configuring the AMQP broker
      2. Streaming messages to AMQ in the cloud
    5. Summary
  21. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think
13.59.9.236