Book description
Use Spring Boot to build lightning-fast apps
About This Book
- Get up to date with the defining characteristics of Spring Boot 2.0 in Spring Framework 5
- Learn to perform Reactive programming with SpringBoot
- Learn about developer tools, AMQP messaging, WebSockets, security, MongoDB data access, REST, and more
Who This Book Is For
This book is designed for both novices and experienced Spring developers. It will teach you how to override Spring Boot's opinions and frees you from the need to define complicated configurations.
What You Will Learn
- Create powerful, production-grade applications and services with minimal fuss
- Support multiple environments with one artifact, and add production-grade support with features
- Find out how to tweak your apps through different properties
- Use custom metrics to track the number of messages published and consumed
- Enhance the security model of your apps
- Make use of reactive programming in Spring Boot
- Build anything from lightweight unit tests to fully running embedded web container integration tests
In Detail
Spring Boot provides a variety of features that address today's business needs along with today's scalable requirements. In this book, you will learn how to leverage powerful databases and Spring Boot's state-of-the-art WebFlux framework. This practical guide will help you get up and running with all the latest features of Spring Boot, especially the new Reactor-based toolkit.
The book starts off by helping you build a simple app, then shows you how to bundle and deploy it to the cloud. From here, we take you through reactive programming, showing you how to interact with controllers and templates and handle data access. Once you're done, you can start writing unit tests, slice tests, embedded container tests, and even autoconfiguration tests.
We go into detail about developer tools, AMQP messaging, WebSockets, security, and deployment. You will learn how to secure your application using both routes and method-based rules. By the end of the book, you'll have built a social media platform from which to apply the lessons you have learned to any problem. If you want a good understanding of building scalable applications using the core functionality of Spring Boot, this is the book for you.
Style and approach
This book takes a tutorial-based approach to teach you all you need to know to get up and running with the latest version of Spring Boot. Filled with examples, you will gain hands-on experience of every area that Spring tackles.
Table of contents
- Preface
- Quick Start with Java
-
Reactive Web with Spring Boot
- Creating a reactive web application with Spring Initializr
- Learning the tenets of reactive programming
- Introducing Reactor types
- Switching from Embedded Netty to Apache Tomcat
- Comparing reactive Spring WebFlux against classic Spring MVC
- Showing some Mono/Flux-based endpoints
- Creating a reactive ImageService
- Creating a reactive file controller
- Why use reactive programming?
- Interacting with a Thymeleaf template
- Illustrating how going from async to sync can be easy, but the opposite is not
- Summary
- Reactive Data Access with Spring Boot
- Testing with Spring Boot
- Developer Tools for Spring Boot Apps
- AMQP Messaging with Spring Boot
-
Microservices with Spring Boot
- A quick primer on microservices
- Dynamically registering and finding services with Eureka
- Introducing @SpringCloudApplication
- Calling one microservice from another with client-side load balancing
- Implementing microservice circuit breakers
- Monitoring circuits
- Offloading microservice settings to a configuration server
- Summary
-
WebSockets with Spring Boot
- Publishing saved comments to a chat service
- Creating a chat service to handle WebSocket traffic
- Consuming WebSocket messages from the web page
- Moving to a fully asynchronous web client
- Handling AJAX calls on the server
- Introducing user chatting
- Sending user-specific messages
- Checking out the final product
- JSR 356 versus Spring WebFlux messaging
- Summary
-
Securing Your App with Spring Boot
- Securing a Spring Boot application
- Using Spring Session
- Securing the chat microservice
- Sharing session details with other microservices
- Securing the images microservice
- Wiring in image ownership
- Tailoring the UI with authorization checks
- Securing WebSockets
- Tracing calls
- Securing the Config Server
- Securing the Eureka Server
- Summary
- Taking Your App to Production with Spring Boot
Product information
- Title: Learning Spring Boot 2.0 - Second Edition
- Author(s):
- Release date: November 2017
- Publisher(s): Packt Publishing
- ISBN: 9781786463784
You might also like
book
Mastering Spring Boot 2.0
Learn to develop, test, and deploy your Spring Boot distributed application and explore various best practices. …
video
Spring Boot Fundamentals
Spring is one of the most widely used frameworks in the industry. Whether you are an …
video
Reactive Spring Boot, 2nd Edition
6 Hours of Video Instruction Spring is the most used framework for building services and applications …
book
Beginning Spring Boot 2: Applications and Microservices with the Spring Framework
Learn Spring Boot and how to build Java-based enterprise, web, and microservice applications with it. In …