O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Cloud Native Java, 1st Edition

Book Description

With Early Release ebooks, you get books in their earliest form—the author's raw and unedited content as he or she writes—so you can take advantage of these technologies long before the official release of these titles. You'll also receive updates when significant changes are made, new chapters are available, and the final ebook bundle is released.

Learn the essentials of the Spring Boot microframework for developing modern, cloud-ready JVM applications and microservices across a variety of environments. With this practical book, you’ll learn everything you need to know to get started working with Spring Boot.

A modern cloud-native architecture looks very different from the architectures inspired by the economics of scale ten years ago. Now that the cloud is the default for everyone—and not just trailblazers like Google, Amazon, Twitter, and Netflix—Spring Boot and Spring Cloud offer the best tools to commoditize the architecture of the cloud. This book shows you how to leverage Spring Boot to build modular, highly-scalable applications.

Table of Contents

  1. Foreword
  2. Preface
    1. Conventions Used in This Book
    2. Using Code Examples
    3. Safari® Books Online
    4. How to Contact Us
    5. Acknowledgments
  3. 1. Bootcamp: Introducing Spring Boot
    1. Getting Started with the Spring Tool Suite
      1. Installing Spring Tool Suite
    2. Spring Boot Starters
    3. Getting Started with the Spring Initializr
      1. Generating Spring Boot applications
    4. The Spring Guides
    5. Auto-Configuration
      1. Spring Boot Configuration
  4. 2. The Cloud Native Application
    1. Platforms
      1. Building Platforms
    2. The Patterns
    3. Netflix’s Story
      1. Splitting the Monolith
      2. Netflix OSS
    4. The Twelve Factors
  5. 3. 12-Factor Application Style Configuration
    1. The Confusing Conflation of “Configuration”
    2. Support in Spring framework
      1. The PropertyPlaceholderConfigurer
      2. The Environment Abstraction and @Value
      3. Profiles
    3. Bootiful Configuration
    4. Centralized, Journaled Configuration with the Spring Cloud Configuration Server
      1. Security
    5. Refreshable Configuration
    6. Next Steps
  6. 4. Testing
    1. Testing in Spring Boot
    2. Integration Testing
      1. Test Slices
      2. Mocking in Tests
      3. Testing Annotations
    3. End-to-end Testing
      1. Testing Distributed Systems
      2. Consumer-driven Contract Testing
      3. Spring Cloud Contracts
      4. Continuous Integration
      5. Functional Testing
    4. Behavior-driven Testing
  7. 5. REST APIs
    1. Leonard Richardson’s Maturity Model
    2. Simple REST APIs with Spring MVC
    3. Content Negotiation
      1. Reading and Writing Binary Data
      2. Using Google Protocol Buffers
    4. Error Handling
    5. Hypermedia
      1. Media Type and Schema
    6. API Versioning
    7. Documenting REST APIs
    8. The Client Side
      1. REST Clients for Ad-Hoc Exploration and Interaction
      2. The RestTemplate
  8. 6. Managing Data
    1. Modeling Data
      1. RDBMS
      2. NoSQL
    2. Spring Data
      1. Structure of a Spring Data Application
      2. Domain Class
      3. Repositories
      4. Organizing Java Packages for Domain Data
    3. Auto-configuration
    4. Bootstrapping Datasource Dependencies
      1. Datasource Connections
    5. JDBC Template
    6. Spring Data Examples
    7. Spring Data JPA
    8. Spring Data MongoDB
    9. Spring Data Neo4j
    10. Spring Data Redis
      1. Caching
    11. Next Steps
  9. 7. Data Integration
    1. Distributed Transactions
    2. The Saga Pattern
    3. Batch workloads with Spring Batch
    4. Scheduling
    5. Isolating Failures and Graceful Degradation
    6. Task Management
    7. Process-Centric Integration with Workflow
    8. Event Driven Architectures with Spring Integration
      1. Messaging Endpoints
      2. From Simple Components, Complex Systems
    9. Message Brokers, Bridges, the Competing Consumer Pattern and Event-Sourcing
    10. Spring Cloud Stream
      1. A Stream Producer
      2. A Stream Consumer
    11. Spring Cloud Data flow
      1. Streams
      2. Tasks
    12. Next Steps
  10. 8. Using Spring Boot with Java EE
    1. Compatibility and Stability
    2. Dependency Injection with JSR 330 (and JSR 250)
    3. Building REST APIs with JAX-RS (Jersey)
    4. JTA and XA Transaction Management
      1. Resource-Local Transactons with Spring’s PlatformTransactionManager
      2. Global Transactions with the Java Transaction API (JTA)
    5. Deployment in a Java EE Environment
    6. Final Word
  11. 9. Service Brokers
    1. Cloud Foundry
    2. Services Marketplace
      1. Creating Services
      2. Binding Applications
      3. Cloud Foundry Service Brokers
    3. Cloud Controller
    4. Service Broker API
    5. Implementing a Service Broker with Spring Boot
      1. Amazon S3 Service Broker
      2. The Service Catalog
      3. Service Instances
      4. Service Bindings
    6. Deploying the Service Broker
      1. Releasing with BOSH
      2. Releasing with Cloud Foundry
      3. Consuming Service Instances
      4. Extending Spring Boot
  12. 10. The Forklifted Application
    1. The Contract
    2. Migrating Application Environments
      1. the Out-of-the-Box Buildpacks
      2. Customizing Buildpacks
      3. Containerized Applications
    3. Soft-Touch Refactoring to get your application into the cloud
      1. Talking to Backing Services
      2. Achieving Service Parity with Spring
    4. Next Steps
  13. 11. The Observable System
    1. The New Deal
    2. Visibility and Transparency
  14. 12. Push vs. Pull Observability and Resolution
    1. Capturing an Application’s Present Status with Actuator
    2. Metrics
    3. Identifying Your Service with the /info Endpoint
    4. Health Checks
    5. Application Logging
    6. Distributed Tracing
      1. Finding Clues with Spring Cloud Sleuth
      2. How Much Data is Enough?
      3. OpenZipkin: a Picture is worth a Thousand Traces
      4. The OpenTracing Initiative
    7. Dashboards
      1. Monitoring Potentially Risky Service Calls with the Hystrix Dashboard
      2. Codecentric’s Spring Boot Admin
      3. Ordina Microservices Dashboard
    8. Remediation
    9. Next Steps
  15. 13. The Application Centric Cloud
    1. Portable Applications
    2. Cattle
    3. Containerized Workloads
      1. Scheduler
      2. Service Discovery
    4. The Application Framework
      1. Spring Boot
      2. Spring Cloud
  16. 14. Continuous Delivery
    1. Start Here
    2. Every Build is a Release Candidate
    3. Version Control Everything
  17. 15. Edge Services
    1. Greetings
    2. A Simple Edge Service
    3. Netflix Feign
    4. Reactive Programming
    5. Proxies with Netflix Zuul
      1. A Custom Zuul Filter
    6. Security on the Edge
      1. OAuth
      2. Building an OAuth Authorization Server
      3. Building an Implicit OAuth Client with Angular.js
      4. Building a Social OAuth Authorization Server
  18. 16. Routing
    1. Locational Decoupling with Service Registration and Discovery
    2. The DiscoveryClient Abstraction
    3. Cloud Foundry Route Services
    4. Next Steps
  19. Index