万本电子书0元读

万本电子书0元读

顶部广告

Hands-On Microservices with Kotlin电子书

售       价:¥

4人正在读 | 0人评论 9.8

作       者:Juan Antonio Medina Iglesias

出  版  社:Packt Publishing

出版时间:2018-01-29

字       数:48.1万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(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 Docker Swarm ? Explore Spring 5 functional reactive web programming with Spring WebFlux Who This Book Is For If you are a Kotlin developer with a basic knowledge of microservice architectures and now want to effectively implement these services on enterprise-level web applications, then this book is for you What You Will Learn ? Understand microservice architectures and principles ? Build microservices in Kotlin using Spring Boot 2.0 and Spring Framework 5.0 ? Create reactive microservices that perform non-blocking operations with Spring WebFlux ? Use Spring Data to get data reactively from MongoDB ? Test effectively with JUnit and Kotlin ? Create cloud-native microservices with Spring Cloud ? Build and publish Docker images of your microservices ? Scaling microservices with Docker Swarm ? Monitor microservices with JMX ? Deploy microservices in OpenShift Online In Detail With Google's inclusion of first-class support for Kotlin in their Android ecosystem, Kotlin's future as a mainstream language is assured. Microservices help design scalable, easy-to-maintain web applications; Kotlin allows us to take advantage of modern idioms to simplify our development and create high-quality services. With 100% interoperability with the JVM, Kotlin makes working with existing Java code easier. Well-known Java systems such as Spring, Jackson, and Reactor have included Kotlin modules to exploit its language features. This book guides the reader in designing and implementing services, and producing production-ready, testable, lean code that's shorter and simpler than a traditional Java implementation. Reap the benefits of using the reactive paradigm and take advantage of non-blocking techniques to take your services to the next level in terms of industry standards. You will consume NoSQL databases reactively to allow you to create high-throughput microservices. Create cloud-native microservices that can run on a wide range of cloud providers, and monitor them. You will create Docker containers for your microservices and scale them. Finally, you will deploy your microservices in OpenShift Online. Style and approach This book guides the reader in designing and implementing services, achieving production- ready, testable, easy-to-maintain, lean code that's shorter and simpler than a traditional Java implementation.
目录展开

Title Page

Copyright and Credits

Hands-On Microservices with Kotlin

Dedication

Packt Upsell

Why subscribe?

PacktPub.com

Contributors

About the author

About the reviewers

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

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

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

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

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

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

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

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

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

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

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

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

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

Leave a review - let other readers know what you think

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部