Spring: Microservices with Spring Boot
图书信息
| 作者 | Ranga Rao Karanam |
| 出版社 | Packt Publishing |
| ISBN | 9781789137897 |
| 出版时间 | 2018-03-14 |
| 字数 | 142.8万 |
| 分类 | 进口书,外文原版书,电脑,网络 |
读书简介
Unlock the power of Spring Boot to build and deploy production-ready microservices About This Book ? Get to know the advanced features of Spring Boot in order to develop and monitor applications ? Use Spring cloud to deploy and manage microservices on the cloud ? Look at embedded servers and deploy a test application to a PaaS Cloud platform ? Embedded with assessments that will help you revise the concepts you have learned in this book Who This Book Is For This book is aimed at Java developers who knows the basics of Spring programming and want to build microservices with Spring Boot. What You Will Learn ? Use Spring Initializr to create a basic spring project ? Build a basic microservice with Spring Boot ? Implement caching and exception handling ? Secure your microservice with Spring security and OAuth2 ? Deploy microservices using self-contained HTTP server ? Monitor your microservices with Spring Boot actuator ? Learn to develop more effectively with developer tools In Detail Microservices helps in decomposing applications into small services and move away from a single monolithic artifact. It helps in building systems that are scalable, flexible, and high resilient. Spring Boot helps in building REST-oriented, production-grade microservices. This book is a quick learning guide on how to build, monitor, and deploy microservices with Spring Boot. You'll be first familiarized with Spring Boot before delving into building microservices. You will learn how to document your microservice with the help of Spring REST docs and Swagger documentation. You will then learn how to secure your microservice with Spring Security and OAuth2. You will deploy your app using a self-contained HTTP server and also learn to monitor a microservice with the help of Spring Boot actuator. This book is ideal for Java developers who knows the basics of Spring programming and want to build microservices with Spring Boot. This book is embedded with useful assessments that will help you revise the concepts you have learned in this book. Style and approach This book follows a practical approach to teach you how to build, monitor, and deploy microservices with Spring Boot. Note: This book is a blend of text and quizzes, all packaged up keeping your journey in mind. It includes content from the following Packt product: ? Mastering Spring 5.0 by Ranga Rao Karanam
目录
Spring: Microservices with Spring Boot
Credits
Meet Your Expert
Preface
What's in It for Me?
What Will I Get from This Book?
Prerequisites
Chapter 1. Building Microservices with Spring Boot
What is Spring Boot?
Building a Quick Prototype for a Microservice
Primary Goals
Nonfunctional Features
Spring Boot Hello World
Configure spring-boot-starter-parent
Note
spring-boot-starter-parent
Configure pom.xml with the Required Starter Projects
Understanding Starter Projects
Configuring spring-boot-maven-plugin
Creating Your First Spring Boot Launch Class
The SpringApplication Class
The @SpringBootApplication Annotation
Running Our Hello World Application
Auto-configuration
Starter Projects
What is REST?
First REST Service
Simple Method Returning String
Unit Testing
Integration Testing
Simple REST Method Returning an Object
Executing a Request
Unit Testing
Integration Testing
Get Method with Path Variables
Executing a Request
Unit Testing
Integration Testing
Creating a Todo Resource
Request Methods, Operations, and Uris
Beans and Services
Retrieving a Todo List
Executing the Service
Unit Testing
Integration Testing
Retrieving Details for a Specific Todo
Executing the Service
Unit Testing
Integration Testing
Adding A Todo
Postman
Executing the POST Service
Unit Testing
Integration Testing
Spring Initializr
Creating Your First Spring Initializr Project
pom.xml
FirstSpringInitializrApplication.java Class
FirstSpringInitializrApplicationTests Class
A Quick Peek into Auto-Configuration
Summary
Assessments
Chapter 2. Extending Microservices
Exception Handling
Spring Boot Default Exception Handling
Non-Existent Resource
Resource Throwing an Exception
Throwing a Custom Exception
Customizing the Exception Message
Response Status
HATEOAS
Sending HATEOAS Links in Response
Spring Boot Starter HATEOAS
Note
Validation
Enabling Validation on the Controller Method
Defining validations on the Bean
Unit Testing Validations
Documenting REST Services
Generating a Swagger Specification
Swagger UI
Customizing Swagger Documentation Using Annotations
Securing REST Services with Spring Security
Adding Spring Security Starter
Basic Authentication
Integration Testing
Unit Testing
OAuth 2 Authentication
High-level flow
Implementing OAuth 2 authentication for Our Service
Setting up Authorization and Resource Servers:
Note
Executing OAuth Requests
Obtaining an Access Token
Executing the Request Using the Access Token
Integration Test
Internationalization
Caching
Spring-boot-starter-cache
Enabling Caching
Caching Data
JSR-107 Caching Annotations
Auto-Detection Order
Summary
Assessments
Chapter 3. Advanced Spring Boot Features
Externalised Configuration
Customizing Frameworks Through application.properties
Note
Logging
Embedded Server Configuration
Spring MVC
Spring Starter Security
Data Sources, JDBC, and JPA
Other Configuration Options
Custom Properties in Application.Properties
Configuration properties - Type-Safe Configuration Management
Profiles
Profiles-Based Bean Configuration
Other Options for Application Configuration Values
YAML Configuration
Embedded Servers
Switching to Jetty and Undertow
Building a WAR file
Developer Tools
Live Reload
Spring Boot Actuator
HAL Browser
Configuration Properties
Note
Environment Details
Health
Mappings
Beans
Metrics
Auto-Configuration
Debugging
Deploying an Application to Cloud
Cloud Foundry
Note
Summary
Assessments
Chapter 4. Assessment Answers
Lesson 1: Building Microservices with Spring Boot
Lesson 2: Extending Microservices
Lesson 3: Advanced Spring Boot Features
- 饿兔子跳(孙家宇)
- 姚明(1)(读书堂)
- 犹忆武林人未远——民国武林忆旧及安慰武学遗录(安慰)
- Once Upon a Christmas (Mills & Boon Love Inspired)(Pamela Tracy)
- 做人要大气(郑斌)
- 五灯会元校注(第二册)(曾琦云 校注)
- 图说天下学生版 超级兵器传奇 世界王牌武器陆海空大阅兵(套装共3册)(试读本)(薛金冉 编著)
- Gone With the Windsors(Laurie Graham)
