Spring 5.0 by example grasp the fundamentals of Spring 5.0 to build modern, robust, and scalable Java applications
Discover the real power of Spring Framework 5.0 and learn to create powerful applications in its newest version About This Book Learn reactive programming by implementing a reactive application with Spring Webflux Create a robust and scalable messaging application with Spring messaging support Apply...
Other Authors: | |
---|---|
Format: | eBook |
Language: | Inglés |
Published: |
Birmingham, [England] ; Mumbai, [India] :
Packt Publishing
2018.
|
Edition: | First edition |
Subjects: | |
See on Biblioteca Universitat Ramon Llull: | https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009631637106719 |
Table of Contents:
- Cover
- Copyright and Credits
- Dedication
- Packt Upsell
- Contributors
- Table of Contents
- Preface
- Chapter 1: 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
- Chapter 2: 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
- Chapter 3: 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
- Chapter 4: 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
- Chapter 5: 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 microservice's 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
- Chapter 6: 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.
- Chapter 7: 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
- Chapter 8: 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
- Chapter 9: Putting It All Together.
- The airline Bookings microservice.