Hands-on microservices with Kotlin build reactive and cloud-native microservices with Kotlin using Spring 5 and Spring Boot 2.0
Build smart, efficient, and fast enterprise-grade web implementation of the microservices architecture that can be easily scaled. About This Book Write easy-to-maintain lean and clean code with Kotlin for developing better microservices Scale your Microserivces in your own cloud with Docker and Dock...
Otros Autores: | |
---|---|
Formato: | Libro electrónico |
Idioma: | Inglés |
Publicado: |
Birmingham, England :
Packt Publishing
2018.
|
Edición: | First edition |
Materias: | |
Ver en Biblioteca Universitat Ramon Llull: | https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009631631606719 |
Tabla de Contenidos:
- Cover
- Copyright and Credits
- Dedication
- Packt Upsell
- Contributors
- Table of Contents
- Preface
- Chapter 1: Understanding Microservices
- What is a microservice?
- Understanding SoA
- Differentiating microservices from SoA
- From the monolith to microservices
- Microservices principles
- Defining design principles
- Modelled around business capabilities
- Loosely couple
- Single responsibility
- Hiding implementation
- Isolation
- Independently deployable
- Build for failure
- Upstream
- Downstream
- Logging
- Monitoring
- Alerting
- Recovery
- Fallbacks
- Scalability
- Automation
- Domain-Driven Design
- What is Domain-Driven Design
- Ubiquitous language
- Bounded context
- Context mapping
- Using DDD in microservices
- Reactive microservices
- Reactive programming
- Reactive Manifesto
- Responsive
- Resilient
- Elastic
- Message-driven
- Back pressure
- Reactive frameworks
- Reactive Extensions
- Project Reactor
- Java reactive streams
- Akka
- Reactive microservices
- Cloud Native microservices
- Cloud computing
- Containers
- Deployment models
- Private cloud
- Public cloud
- Hybrid cloud
- Service models
- Infrastructure as a Service
- Platform as a Service
- Software as a Service
- Cloud Native microservices
- Summary
- Chapter 2: Getting Started with Spring Boot 2.0
- Creating a Spring Boot application
- Setting up
- Installing JDK 8
- UNIX/Mac OS X
- Windows
- Testing the installation
- Installing Maven 3.5
- Unix /MacOS X
- Windows
- Testing the installation
- Installing IntelliJ IDEA CE 2017.2
- Using Spring Initializr
- Understanding basic usage
- Reviewing the generated project files
- Maven Files
- Source files
- Resource files
- Gitignore
- Understanding advanced usage
- Using Maven
- Life cycle phases
- Introduction to Maven goals.
- Understanding the POM file
- Project definition
- Maven parent
- Project properties
- Dependencies
- Build
- Repositories
- Using IntelliJ IDEA
- Opening our Maven project
- Executing life cycle phases and goals
- Modifying our microservice
- Debugging
- Tips and Tricks
- Spring Boot application structure
- Creating an application object
- Defining Spring application context
- Understanding the component scan
- Using components
- Autowiring
- Packaging and running a Spring Boot application
- Packaging
- Making JARs not WARs
- Running Spring Boot applications
- Creating executable JARs
- Configuring our application
- Setting configuration values
- Using properties
- Using Yaml
- Using command-line arguments
- Understanding Spring Expression Language
- Using profiles
- Defining profile values
- Executing with profiles
- Creating conditional beans
- Creating beans explicitly
- Defining an additional bean
- Defining beans with conditionals
- Running different configurations
- Summary
- Chapter 3: Creating RESTful Services
- Understanding RestController
- What is a controller
- Creating a RestController
- Understanding our controller
- Path and request parameters
- Creating a map of customers
- Getting path variables
- Understanding path variables
- Defining request parameters
- Understanding request parameters
- HTTP verbs and statuses
- Standard HTTP verbs and statuses
- Single resources
- Collections
- Generic errors
- Handling HTTP verbs
- Handling HTTP POST
- Handling HTTP DELETE
- Handling HTTP PUT
- Using verb and mapping annotations
- Implementing a service layer
- Creating a service interface
- Creating an implementation
- Binding the right bean
- Using the service
- Handling HTTP statuses
- Using ResponseEntity
- Answering a GET request
- Answering a POST request.
- Answering a DELETE request
- Answering an UPDATE request
- Empty responses
- Working with JSON
- Understanding serialization
- Using simple objects
- Working with complex objects
- Adding telephones to our customers
- Handling null values
- Understanding deserialization
- From a request into an object
- Deserializing complex objects
- Validating objects
- Handling errors
- Using controller advice
- Creating business exceptions
- Avoiding the controller advice
- Summary
- Chapter 4: Creating Reactive Microservices
- Understanding Spring WebFlux
- Creating a Spring WebFlux application
- Using Netty
- Serving static context
- Adding a RestController
- Creating a customer service
- Blocking is not reactive
- Creating reactive services
- Understanding subscribers and publishers
- Publishing a single object
- Using Mono in a service
- Publishing multiple objects
- Using Flux in a service
- Receiving objects reactively
- Using functional web programming
- Using RouterFunction
- Creating handlers
- Using reactive services
- Handling multiple routes
- Using query parameters
- Processing a JSON body
- Handling reactive errors
- Capturing errors on Handlers
- Publishing errors
- Summary
- Chapter 5: Reactive Spring Data
- NoSQL databases
- What is a SQL database?
- What is a NoSQL database?
- Installing MongoDB
- Starting our database server
- Connecting with the Mongo client
- Creating a database
- Using commands
- Using Spring Data
- Setting up the project
- Configuring our connection
- Sending commands to MongoDB
- Reactive repositories
- Creating a repository
- Using the repository
- Completing our initialization
- Using ReactiveMongoTemplate
- From CRUD to REST
- Bringing back our service
- Mapping GET to READ
- Mapping POST to CREATE
- Mapping DELETE
- Finding Customers
- Summary.
- Chapter 6: Creating Cloud-Native Microservices
- Understanding Spring Cloud
- What is a Cloud-Native application?
- Spring Cloud architecture
- Configuration server
- Service discovery
- Load Balancer
- Gateway
- Circuit breaker
- Spring Cloud Netflix
- Creating a Spring Cloud microservice
- Configuration Server
- Creating a Configuration Server
- Getting configurations
- Ciphering data
- Using application profiles
- Service discovery
- Creating a Service Discovery Server
- Connecting to the Discovery Server
- Using Spring Boot actuator
- Gateway
- Creating a Gateway
- Defining routes
- Summary
- Chapter 7: Creating Dockers
- Starting with Docker
- Understanding containers
- Virtual machines
- Containers
- Docker
- Installing Docker
- Starting with Docker
- Pulling images
- Managing images
- Building Dockers with microservices
- Creating an example microservice
- Creating a Dockerfile
- Dockerize our microservice
- Running the microservice
- Publishing Dockers
- Understanding repositories
- Creating an account on Docker Hub
- Publishing a Docker
- Integrating Docker with Maven
- Summary
- Chapter 8: Scaling Microservices
- A scalable architecture
- Scaling directions
- Vertical scaling
- Horizontal scaling
- Design for scaling
- Independently scaling
- Scaling down
- Creating a Cloud
- Creating a swarm
- Adding a service
- Getting logs from a service
- Deleting a service
- Publishing a microservice as a service
- Creating a registry
- Creating a microservice
- Creating our Docker
- Creating the service
- Controlling services
- Scaling instances
- Getting logs from a service
- Controlling the service
- Summary
- Chapter 9: Testing Spring Microservices
- Understanding SpringBootTest
- Creating a simple microservice
- Understanding SpringBootTest
- Testing beans
- Using MockMvc.
- Mocking beans
- Why we mock
- Setting up a mock
- Returning mocked values
- Verifying Mock invocation
- Fluent tests
- Adding Kluent
- Testing our services expressively
- Testing our controller expressively
- Summary
- Chapter 10: Monitoring Microservices
- Understanding monitoring
- What is monitoring?
- Alerting
- Recovering
- Building a failing microservice
- SpringBoot Actuator
- Enabling SpringBoot Actuator
- Understanding Actuator's endpoints
- Health endpoint
- Metrics endpoint
- Trace endpoint
- Defining health indicators
- Protecting Actuator endpoints
- Java Managing Extensions
- Understanding JMX
- Using JMX
- Create management beans
- Summary
- Chapter 11: Deploying Microservices
- Setting things up
- Creating a GitHub account
- Installing Git
- Create an OpenShift account
- Downloading the OpenShift client
- Building our application
- Creating an example microservice
- Adding tests
- Uploading to GitHub
- Publishing to OpenShift
- Creating an application
- Managing our application
- Updating the application
- Summary
- Chapter 12: Best Practices
- Using Kotlin idioms
- Inferred types
- Expressions
- Default parameters
- Lambda
- Managing the Spring context
- Constructor injection
- Explicit context configuration
- Decouple services
- Layering the application
- Understanding our classes
- Domains
- Splitting
- Testing effectively
- Understanding type of tests
- Unit tests
- Integration tests
- E2E tests
- Other tests
- Testing pyramid
- Test Driven Development
- Behavior-Driven Development
- Handling CI and CD
- Continuous Integration
- Continuous Delivery
- Pipeline
- Dashboard
- Summary
- Other Books You May Enjoy
- Index.