Beginners Guide to MicroServices
This book will guide Java developers of junior or standard grade who have some server stack experience into being able to write fully functional microservice based systems.
SaaS Industries is currently leveraging one primary core ecosystem, Spring Boot, to develop our microservices. Spring Boot provides "convention over configuration" as a goal, but we will see we still need to do some configuring to be able to run the service. Spring Boot primarily uses Maven as a build tool, but Gradle is available as an option. It is hard to call Spring Boot a framework because while it has opinions on how to develop, it is still pretty loose on how things are done. What Spring Boot does provide us is many plugins (dependencies), build tools, etc, that allow us to pick the development patterns of our choice.
If you were to imagine Java as our bedrock to build a house upon, Spring Boot provides our foundation. To begin to build our frame, we use Apache Camel. Camel is an ESB with exceptional EIP support. So much so that you will learn how we use Camel to provide our public facing endpoints via REST, use various patterns to process while in the microservices ESB, and then if needed, publish our data to an internal messaging system named RabbitMQ.
A microservice may not be public facing and simply consume (and maybe even still produce) from RabbitMQ. Typically you will find that our consumers are services that provide persistency. In these cases, we use Grails as a framework inside these microservices. Grails is a Model-View-Control patterned framework. Since we do not provide any views in browser based formats, e.g. html, javascript, etc, through our server stack, it should then be obvious we are not concerned with the View part of the pattern in MVC.
This book will first guide you through a Grails MVC application. When completed, we will refactor the application to use Camel. Then we will partition the application into contextual domains, refactoring again to create separate applications bounded to their context. To connect those applications we will then integrate RabbitMQ, learning the Camel RabbitMQ component. Once we have a simple, but complete, microservice based application, we will then dockerize each part, including Rabbit. The Docker container provide immutable servers that Kubernetes can use to scale, restart, etc. This means we will also need to configure our application to allow for Kubernetes to control the Docker containers. Finally we will be able to push our newly formed services into the cloud where OpenShift and Fabric8 can take over.