-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Hands-On Microservices with Kotlin
By :

With Google's announcement of introducing first-class support for Kotlin in their Android ecosystem, Kotlin is realized as a mainstream language.
Microservices helps with designing scalable, easy-to-maintain web applications, and Kotlin allows us to take advantage of modern idioms to simplify our development and create high-quality services.
With 100% of interoperability with the JVM, Kotlin makes it easy to work with the existing Java code.
Popular Java frameworks, such as Spring, Jackson, and Reactor, have included Kotlin modules to take advantage of language features such as null safety and type-safe declarative builders.
This book will guide the reader through designing and implementing services to having the production-ready testable code, creating easy-to-maintain and lean code that will be shorter and simpler than a traditional Java implementation.
We will discover the benefits of using the reactive paradigm in order to take advantage of non-blocking techniques and take our services to the next level of industry standards.
During the journey, we'll consume NoSQL databases reactively in order to create high- throughput microservices.
In this book, we will demonstrate how we can create Cloud-Native microservices that can run in a wide range of cloud providers, and how we can monitor them.
We will create Docker containers for our microservices and learn how to scale them.
Finally, we will deploy our microservices in Openshift Online.
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.
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.
To get up and running, users will need to have the following software installed:
You can download the example code files for this book from your account at www.packtpub.com. If you purchased this book elsewhere, you can visit www.packtpub.com/support and register to have the files emailed directly to you.
You can download the code files by following these steps:
SUPPORT
tabCode Downloads & Errata
Search
box and follow the onscreen instructionsOnce the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:
The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Hands-On-Microservices-with-Kotlin.
When this book was written, the current snapshot version of Spring Boot 2 was Spring Boot 2.0.0 M7
. The code bundle and examples are up to date with that version. Eventually, Spring Boot 2.0.0
will be finally released and the code bundle will be updated accordingly.
We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://www.packtpub.com/sites/default/files/downloads/HandsOnMicroserviceswithKotlin_ColorImages.pdf.
There are a number of text conventions used throughout this book.
CodeInText
: Indicates code words in the text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "Mount the downloaded WebStorm-10*.dmg
disk image file as another disk in your system."
A block of code is set as follows:
package com.microservices.chapter2 interface ServiceInterface { fun getHello(name : String) : String }
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
<build> .... <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <executable>true</executable> </configuration> </plugin> .... </build>
Any command-line input or output is written as follows:
mvnwspring-boot:run mvnw compile
Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Select System info from the
"Administration
panel.
Warnings or important notes appear like this.
Tips and tricks appear like this.
Feedback from our readers is always welcome.
General feedback: Email [email protected]
and mention the book title in the subject of your message. If you have questions about any aspect of this book, please email us at [email protected]
.
Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.
Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected]
with a link to the material.
If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.
Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!
For more information about Packt, please visit packtpub.com.
Change the font size
Change margin width
Change background colour