Book Image

Hands-On Microservices with Kotlin

By : Juan Antonio Medina Iglesias
Book Image

Hands-On Microservices with Kotlin

By: Juan Antonio Medina Iglesias

Overview of this book

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.
Table of Contents (14 chapters)

What this book covers

Chapter 1, Understanding Microservices, introduces microservices and their principles. We will review Domain-Driven Design, Cloud-Native microservices, and Reactive architecture.

Chapter 2, Getting Started with Spring Boot 2.0, helps develop our first microservice with Kotlin using Spring Boot 2.0. We will take a deep dive into the Spring Boot and see how we can use IntelliJ IDEA to build our microservices.

Chapter 3, Creating RESTful Services, expands our Cloud-Native microservices to become RESTful APIs, introducing different Spring components.

Chapter 4, Creating Reactive Microservices, creates non-blocking reactive microservices. We will learn how we can use Spring WebFlux and project Reactor to build reactive microservices.

Chapter 5, Reactive Spring Data, focuses on how we can use reactive Spring Data to perform operations against NoSQL databases such as MongoDB. Then, it looks at how we can enhance our reactive microservices creating reactive CRUD operations for our REST APIs.

Chapter 6, Creating Cloud-Native Microservices, outlines what Cloud-Native microservices are, and how we can easily build with Spring Cloud.

Chapter 7, Creating Dockers, informs how to install and configure Docker to create, publish, and run containers, and how we can integrate this when we build our microservices with Maven.

Chapter 8, Scaling Microservices, showcases how we can Docker swarm to create our own personal cloud, and how we can scale and control our microservices.

Chapter 9, Testing Spring Microservices, covers how we can test our microservices using JUnit using SpringBootTest. We will learn how we can test our microservice in a more expressive way by using Kluent to do fluent tests.

Chapter 10, Monitoring Microservices, discusses why monitoring is a critical part of any production-ready system, and how we can provide microservices that can be monitored and controlled using Spring Boot Actuator and JMX.

Chapter 11, Deploying Microservices, explains how to deploy our microservices Dockers in OpenShift Online, and how we can integrate GitHub to do automatic deployments when our microservices code changes.

Chapter 12, Best Practices, goes through industry best practices that we can use to create our microservices.