Spring 5.0 By Example
Claudio Eduardo de Oliveira更新时间:2021-06-24 19:18:27
最新章节:Leave a review - let other readers know what you thinkcoverpage
Title Page
Dedication
Packt Upsell
Why subscribe?
PacktPub.com
Contributors
About the author
About the reviewer
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Get in touch
Reviews
Journey to the Spring World
Spring modularity
Spring Core Framework
Core container
Spring Messaging
Spring AMQP
Spring for Apache Kafka
Spring JMS
Spring Web MVC
Spring WebFlux
Spring Data
Spring Security
Spring Cloud
Spring Cloud Netflix
Spring Cloud Config
Spring Cloud Consul
Spring Cloud Security
Spring Cloud Bus
Spring Cloud Stream
Spring Integration
Spring Boot
Microservices and Spring Boot
Setting up our development environment
Installing OpenJDK
Installing Maven
Installing IDE
IntelliJ IDEA
Spring Tools Suite
Installing Docker
Introducing Docker concepts
Docker images
Containers
Docker networks
Docker volumes
Docker commands
Docker run
Docker container
Docker network
Docker volume
Summary
Starting in the Spring World – the CMS Application
Creating the CMS application structure
The CMS project
Project metadata section
The dependencies section
Generating the project
Running the application
Looking under the hood
Running the application
IntelliJ IDEA
Command line
Command line via the Maven goal
Command line via the JAR file
Creating the REST resources
Models
Adding Lombok dependency
Creating the models
Tag
Category
User
News
Hello REST resources
Creating the CategoryResource class
UserResource
NewsResource
Adding service layer
Changes in the model
Adding a new review
Keeping the news safely
Before starting the service layer
CategoryService
UserService
NewsService
Configuring Swagger for our APIs
Adding dependencies to pom.xml
Configuring Swagger
First documented API
Integrate with AngularJS
AngularJS concepts
Controllers
Services
Creating the application entry point
Creating the Category Controller
Creating the Category Service
Summary
Persistence with Spring Data and Reactive Fashion
Learning the basics of Docker
Preparing MongoDB
Preparing a PostgreSQL database
Spring Data project
Spring Data JPA
Configuring pom.xml for Spring Data JPA
Configuring the Postgres connections
Mapping the models
Adding the JPA repositories in the CMS application
Configuring transactions
Installing and configuring pgAdmin3
Checking the data on the database structure
Creating the final data access layer
Spring Data MongoDB
Removing the PostgreSQL and Spring Data JPA dependencies
Mapping the domain model
Configuring the database connection
Adding the repository layer
Checking the persistence
Creating the Docker image for CMS
Configuring the docker-maven-plugin
Adding the plugin on pom.xml
Pushing the image to Docker Hub
Configuring the Docker Spring profile
Running the Dockerized CMS
Putting in Reactive fashion
Reactive Spring
Project Reactor
Components
Hot and cold
Reactive types
Let's play with the Reactor
Spring WebFlux
Event-loop model
Spring Data for Reactive Extensions
Spring Data Reactive
Reactive repositories in practice
Creating the first Reactive repository
Fixing the service layer
Changing the CategoryService
Changing the REST layer
Adding the Spring WebFlux dependency
Changing the CategoryResource
Summary
Kotlin Basics and Spring Data Redis
Learning Kotlin basics
Main characteristics of Kotlin
Syntax
Semantics
Declaring functions in Kotlin
Simple function with parameters and return type
Simple function without return
Single expressions functions
Overriding a function
Data classes
Objects
Companion objects
Kotlin idioms
String interpolation
Smart Casts
Range expressions
Simple case
The until case
The downTo case
Step case
Null safety
Safe calls
Elvis operator
Wrapping it up
Creating the project
Project use case
Creating the project with Spring Initializr
Adding Jackson for Kotlin
Looking for the Maven plugins for Kotlin
Creating a Docker network for our application
Pulling the Redis image from the Docker Hub
Running the Redis instance
Configuring the redis-cli tool
Understanding Redis
Data types
Strings
Main commands
Lists
Main commands
Sets
Main commands
Spring Data Reactive Redis
Configuring the ReactiveRedisConnectionFactory
Providing a ReactiveRedisTemplate
Creating Tracked Hashtag repository
Creating the service layer
Exposing the REST resources
Creating a Twitter application
Configuring pom.xml
Creating the image
Running the container
Testing APIs
Summary
Reactive Web Clients
Creating the Twitter Gathering project
Project structure
Starting the RabbitMQ server with Docker
Pulling the RabbitMQ image from Docker Hub
Starting the RabbitMQ server
Spring Messaging AMQP
Adding Spring AMQP in our pom.xml
Integrating Spring Application and RabbitMQ
Understanding RabbitMQ exchanges queues and bindings
Exchanges
Direct exchanges
Fanout exchanges
Topic exchanges
Header exchanges
Queues
Bindings
Configuring exchanges queues and bindings on Spring AMQP
Declaring exchanges queues and bindings in yaml
Declaring Spring beans for RabbitMQ
Consuming messages with Spring Messaging
Producing messages with Spring Messaging
Enabling Twitter in our application
Producing Twitter credentials
Configuring Twitter credentials in application.yaml
Modelling objects to represent Twitter settings
Twittertoken
TwitterAppSettings
Declaring Twitter credentials for the Spring container
Spring reactive web clients
Producing WebClient in a Spring Way
Creating the models to gather Tweets
Authentication with Twitter APIs
Some words about server-sent events (SSE)
Creating the gather service
Listening to the Rabbit Queue and consuming the Twitter API
Changing the Tracked Hashtag Service
Adding the Spring Starter RabbitMQ dependency
Configuring the RabbitMQ connections
Creating exchanges queues and bindings for the Twitter Hashtag Service
Sending the messages to the broker
Testing the microservices' integrations
Running Tracked Hashtag Service
Running the Twitter Gathering
Testing stuff
Spring Actuator
Adding Spring Boot Actuator in our pom.xml
Actuator Endpoints
Application custom information
Testing endpoints
Summary
Playing with Server-Sent Events
Creating the Tweet Dispatcher project
Using Spring Initializr once again
Additional dependencies
Server-Sent Events
A few words about the HTTP protocol
HTTP and persistent connections
WebSockets
Server-Sent Events
Reactor RabbitMQ
Understanding the Reactor RabbitMQ
Configuring RabbitMQ Reactor beans
Consuming the RabbitMQ queues reactively
Filtering streams
Dockerizing the whole solution
Tweet Gathering
Tweet Dispatcher
Running the containerized solution
Running the Tracked Hashtag Service container
Running the Tweet Gathering container
Running the Tweet Dispatcher container
The docker-compose tool
Installing docker-compose
Creating a docker-compose file
Running the solution
Testing the network
Summary
Airline Ticket System
The Airline Ticket System
Airline functionalities
Solution diagram
Spring Cloud Config Server
Creating the Config Server project
Enabling Spring Cloud Config Server
Using GitHub as a repository
Configuring the Spring Boot application
Configuring the Git repository as a properties source
Running the Config Server
Testing our Config Server
Spring Cloud service discovery
Creating Spring Cloud Eureka
Creating the Eureka server main class
Configuring the Spring Cloud Eureka server
Running the Spring Cloud Eureka server
Spring Cloud Zipkin server and Sleuth
Infrastructure for the Zipkin server
Creating the Spring Cloud Zipkin server
Configuring boostrap.yaml and application.yaml
Running the Zipkin server
Spring Cloud Gateway
Creating the Spring Cloud Gateway project
Creating the Spring Cloud Gateway main class
Configuring the Spring Cloud Gateway project
Running the Spring Cloud Gateway
Checking the Eureka server
Creating our first route with Spring Cloud Gateway
Putting the infrastructure on Docker
Summary
Circuit Breakers and Security
Understanding the service discovery power
Creating the planes microservice
Coding the planes microservice
The reactive repository
Creating the Plane service
The REST layer
Running the plane microservice
Flights microservice
Cloning the Flight microservice project
Netflix Ribbon
Understanding the discovery client
Service discovery and load balancing in practice
When the services fail hello Hystrix
Hystrix in a nutshell
Spring Cloud Hystrix
Spring Boot Admin
Running Spring Boot Admin
Spring Cloud Zuul
Understanding the EDGE service project
Creating the EDGE server
Summary
Putting It All Together
The airline Bookings microservice
The airline Payments microservice
Learning about the Turbine server
Creating the Turbine server microservice
Hystrix Dashboard
Creating the Mail microservice
Creating the SendGrid account
Creating the Mail microservice project
Adding RabbitMQ dependencies
Configuring some RabbitMQ stuff
Modeling a Mail message
The MailSender class
Creating the RabbitMQ queue listener
Running the Mail microservice
Creating the Authentication microservice
Creating the Auth microservice
Configuring the security
Testing the Auth microservice
Client credentials flow
Implicit grant flow
Protecting the microservices with OAuth 2.0
Adding the security dependency
Configuring the application.yaml file
Creating the JwtTokenStore Bean
Monitoring the microservices
Collecting metrics with Zipkin
Collection commands statistics with Hystrix
Dockerizing the microservices
Running the system
Summary
Other Books You May Enjoy
Leave a review - let other readers know what you think
更新时间:2021-06-24 19:18:27