Book Image

Microservices Deployment Cookbook

By : Vikram Murugesan
Book Image

Microservices Deployment Cookbook

By: Vikram Murugesan

Overview of this book

This book will help any team or organization understand, deploy, and manage microservices at scale. It is driven by a sample application, helping you gradually build a complete microservice-based ecosystem. Rather than just focusing on writing a microservice, this book addresses various other microservice-related solutions: deployments, clustering, load balancing, logging, streaming, and monitoring. The initial chapters offer insights into how web and enterprise apps can be migrated to scalable microservices. Moving on, you’ll see how to Dockerize your application so that it is ready to be shipped and deployed. We will look at how to deploy microservices on Mesos and Marathon and will also deploy microservices on Kubernetes. Next, you will implement service discovery and load balancing for your microservices. We’ll also show you how to build asynchronous streaming systems using Kafka Streams and Apache Spark. Finally, we wind up by aggregating your logs in Kafka, creating your own metrics, and monitoring the metrics for the microservice.
Table of Contents (15 chapters)
Microservices Deployment Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Building an executable JAR using Maven Shade plugin


Before we jump into this recipe, let's talk about why we are doing this. Our goal is to construct a shippable artifact that can be executed from any platform or machine. In order to do that, we have to make sure our final artifact has all dependencies packaged in it. All we are trying to do here is build a fat JAR with all dependencies, called the uber JAR, which we talked about in the previous chapter. Almost all frameworks that help build microservices, such as Spring Boot and WildFly Swarm, have their own Maven plugins that help you build an executable JAR.

But if you use frameworks such as SparkJava and RatPack that are not really microservice frameworks but help in building HTTP APIs, you will have to make sure you use the right Maven or Gradle plugin to create an executable JAR.

Note

Ratpack is a framework that lets you build high-performance HTTP services. Internally, it uses Netty as its HTTP engine. It utilizes Netty's event-based...