Professional Documents
Culture Documents
Download full chapter Cloud Native Java Designing Resilient Systems With Spring Boot Spring Cloud And Cloud Foundry 1St Edition Long pdf docx
Download full chapter Cloud Native Java Designing Resilient Systems With Spring Boot Spring Cloud And Cloud Foundry 1St Edition Long pdf docx
https://textbookfull.com/product/spring-boot-up-and-running-
building-cloud-native-java-and-kotlin-applications-mark-heckler/
https://textbookfull.com/product/practical-microservices-
architectural-patterns-event-based-java-microservices-with-
spring-boot-and-spring-cloud-christudas/
https://textbookfull.com/product/practical-microservices-
architectural-patterns-event-based-java-microservices-with-
spring-boot-and-spring-cloud-1st-edition-binildas-christudas/
https://textbookfull.com/product/spring-cloud-data-flow-native-
cloud-orchestration-services-for-microservice-applications-on-
modern-runtimes-1st-edition-felipe-gutierrez/
Learn Microservices with Spring Boot: A Practical
Approach to RESTful Services Using an Event-Driven
Architecture, Cloud-Native Patterns, and
Containerization 2nd Edition Moisés Macero García
https://textbookfull.com/product/learn-microservices-with-spring-
boot-a-practical-approach-to-restful-services-using-an-event-
driven-architecture-cloud-native-patterns-and-
containerization-2nd-edition-moises-macero-garcia/
https://textbookfull.com/product/spring-boot-persistence-best-
practices-optimize-java-persistence-performance-in-spring-boot-
applications-1st-edition-anghel-leonard/
https://textbookfull.com/product/cloud-native-devops-with-
kubernetes-1st-edition-john-arundel/
https://textbookfull.com/product/kubernetes-patterns-reusable-
elements-for-designing-cloud-native-applications-1st-edition-
bilgin-ibryam/
https://textbookfull.com/product/beginning-quarkus-framework-
build-cloud-native-enterprise-java-applications-and-
microservices-1st-edition-tayo-koleoso/
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
Cloud Native Java
First Edition
Designing Resilient Systems with Spring Boot, Spring Cloud, and Cloud
Foundry
While the publisher and the authors have used good faith efforts to ensure
that the information and instructions contained in this work are accurate, the
publisher and the authors disclaim all responsibility for errors or omissions,
including without limitation responsibility for damages resulting from the use
of or reliance on this work. Use of the information and instructions contained
in this work is at your own risk. If any code samples or other technology this
work contains or describes is subject to open source licenses or the
intellectual property rights of others, it is your responsibility to ensure that
your use thereof complies with such licenses and/or rights.
978-1-4493-7464-8
[???]
Foreword
Forward goes here
Preface
Conventions Used in This Book
The following typographical conventions are used in this book:
Italic
Shows commands or other text that should be typed literally by the user.
Constant width italic
Tip
Note
Warning
This book is here to help you get your job done. In general, if example code
is offered with this book, you may use it in your programs and
documentation. You do not need to contact us for permission unless you’re
reproducing a significant portion of the code. For example, writing a program
that uses several chunks of code from this book does not require permission.
Selling or distributing a CD-ROM of examples from O’Reilly books does
require permission. Answering a question by citing this book and quoting
example code does not require permission. Incorporating a significant
amount of example code from this book into your product’s documentation
does require permission.
If you feel your use of code examples falls outside fair use or the permission
given above, feel free to contact us at permissions@oreilly.com.
Safari® Books Online
Note
Safari Books Online offers a range of plans and pricing for enterprise,
government, education, and individuals.
We have a web page for this book, where we list errata, examples, and any
additional information. You can access this page at
http://www.oreilly.com/catalog/0636920038252.
For more information about our books, courses, conferences, and news, see
our website at http://www.oreilly.com.
This chapter will introduce you to building Spring Boot applications. The
topics we will go over are:
Spring Initializr
Starter Projects
Auto-configuration
Getting Started with the Spring
Tool Suite
The Spring Tool Suite (STS) is an Eclipse distribution that is customized for
developing Spring applications. STS is a freely available IDE under the terms
of the Eclipse Public License. While there are many IDE options available for
developing your Spring applications, STS provides a set of features that are
tailored for Spring-based development.
Installing Spring Tool Suite
Let’s get started with downloading and installing the Spring Tool Suite,
available from http://www.spring.io.
Go to https://spring.io/tools/sts
After you have downloaded, extracted, and have run the STS program, you
will be prompted to choose a workspace location.
Choose your desired workspace location and click OK. If you plan to use the
same workspace location each time you run STS, click on the option "Use
this as the default and do not ask again“.
After you have provided a workspace location and clicked OK, the STS IDE
will load for the first time.
Figure 1-2. The STS dashboard
To create a new Spring Boot application using a Spring Boot Starter project,
choose from the menu File > New > Spring Boot Starter Project.
Figure 1-3. Create a new Spring Boot Starter Project
After choosing to create a new Spring Boot Starter Project, you will be
presented with a dialog to configure your new Spring Boot application.
Figure 1-4. Configure your new Spring Boot Starter Project
You can configure your options, but for the purposes of this simple
walkthrough, let’s use the defaults and click Next. After clicking Next, you
will be provided with a set of Spring Boot Starter projects that you can
choose for your new Spring Boot application. For our first application we’re
going to choose the Spring Boot Starter Web project.
Figure 1-5. Choose your Spring Boot Start Project
From the list of sections, choose Web to expand its list of options. Now from
the Web section, choose the option Web and click Finish. After you click
Finish, your Spring Boot application with the Spring Boot Starter Web
project dependency will be created.
Now that your project has been created and imported into the STS IDE, you
will notice that a new project is available in your package explorer area.
Figure 1-6. Expand the demo project from the package explorer
If you haven’t already, expand the demo [boot] project and view the project
contents as shown in the screenshot above. From the expanded project files,
navigate to src/main/java/com/example/DemoApplication.java.
This is your main application class for your new Spring Boot application.
STS has configured this project as a Spring Boot starter project with the
spring-boot-starter-web dependency. If you navigate to your pom.xml file in
your Package Explorer you will find that the following dependencies have
been added.
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Now that we understand the makeup of our Spring Boot application, let’s
create our first RESTful service by modifying DemoApplication.java. In
DemoApplication.java, modify the contents so that it looks like the
following example.
package com.example;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@SpringBootApplication
public class DemoApplication {
@RestController
public static class Hello {
@RequestMapping(value = "/hello")
public String hello(
@RequestParam(value = "name", defaultValue = "World")
Now that we have our code for a basic RESTful web service, let’s go ahead
and run the application. Run the application from the Run > Run menu.
After choosing the Run option from the menu, you’ll be presented with a
Save and Launch dialog. Choose the DemoApplication.java option and click
OK.
Figure 1-9. Choose DemoApplication.java and launch the application
Your Spring Boot application will now start up. If you look at your STS
console, you should see the iconic Spring Boot ASCII art and the version of
Spring Boot as it starts up. The log output of the Spring Boot application can
Another random document with
no related content on Scribd:
MEETING OF THE BIOLOGICAL CLUB.
They are already the preferred texts, and the reasons will be
apparent on examination.
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must, at
no additional cost, fee or expense to the user, provide a copy, a
means of exporting a copy, or a means of obtaining a copy upon
request, of the work in its original “Plain Vanilla ASCII” or other
form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.
• You pay a royalty fee of 20% of the gross profits you derive from
the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.
Most people start at our website which has the main PG search
facility: www.gutenberg.org.