Building Microservices with Micronaut®: A quick-start guide to building high-performance reactive microservices for Java developers
Book information
Description
Explore different aspects of building modular microservices such as development, testing, maintenance, and deployment using the Micronaut framework Key FeaturesLearn how to build scalable, fast, and resilient microservices with this concise guideExplore the many advantages of using reflection-free, compile-time dependency injections and aspect-oriented programmingBuild cloud-native applications easily with the Micronaut frameworkBook Description The Micronaut® open source software is a JVM-based framework, designed to create microservices quickly and easily. This book will help full-stack and Java developers to build modular, high-performing, and reactive microservice-based apps using Micronaut. You'll start by building microservices and learning about the core components of Micronaut, such as ahead-of-time compilation, reflection-less dependency injection, and reactive baked-in HTTP clients and servers. Next, you will work on a real-time microservice application and learn how to integrate Micronaut with different kinds of relational and non-relational databases. You'll also learn how to employ different security mechanisms to safeguard your microservices and integrate microservices using event-driven architecture in the Apache Kafka ecosystem. As you advance, you'll get to grips with automated testing and popular testing tools. The book will help you understand how you can easily handle microservice concerns in the Micronaut framework, such as service discovery, API documentation, distributed configuration management, fallbacks, and circuit breakers. Finally, you'll explore the deployment and maintenance aspects of microservices and get up to speed with the Internet of Things (IoT) using Micronaut. By the end of this book, you'll be able to build, test, deploy, and maintain your own microservice apps using Micronaut. What you will learnUnderstand why Micronaut is best suited for building microservicesBuild web endpoints and services in the Micronaut frameworkSafeguard microservices using Session, JWT, and OAuth in MicronautGet to grips with event-driven architecture in MicronautDiscover how to automate testing at various levels using built-in tools and testing frameworksDeploy your microservices to containers and cloud platformsBecome well-versed with distributed logging, tracing, and monitoring in MicronautGet hands-on with the IoT using Alexa and MicronautWho this book is for This book is for developers who have been building microservices on traditional frameworks such as Spring Boot and are looking for a faster alternative. Intermediate-level knowledge of Java programming and implementing web services development in Java is required. Table of ContentsGetting Started with Microservices Using the Micronaut FrameworkWorking on Data AccessWorking on the RESTful Web ServicesSecuring the MicroservicesIntegrating Microservices using the Event-Driven ArchitectureTesting the MicroservicesHandling Microservice ConcernsDeploying MicroservicesDistributed logging, tracing and monitoringIoT with MicronautBuilding enterprise grade microservices Cover Title Page Copyright and Credits Contributors Table of Contents Preface Section 1: Core Concepts and Basics Chapter 1: Getting Started with Microservices Using the Micronaut Framework Technical requirements Introducing microservices and their evolution Understanding microservices design patterns Decomposition design patterns Integration design patterns Data management patterns Cross-cutting patterns Why Micronaut is the best choice for developing microservices Getting started with the Micronaut framework Installing the Micronaut CLI on mac OS Installing the Micronaut CLI on Windows Working on a hello world project in the Micronaut framework Creating a hello world project using the Micronaut CLI Creating a hello world project using Micronaut Launch Summary Questions Section 2: Microservices Development Chapter 2: Working on Data Access Technical requirements Integrating with persistence in the Micronaut framework Integrating with a relational database using an ORM (Hibernate) framework Generating the pet-owner schema in PostgreSQL Creating a Micronaut application for the pet-owner microservice Creating the entity classes Defining relationships among entities Creating data access repositories Creating services for entities Performing basic CRUD operations Wrapping up Integrating with a relational database using a persistence (MyBatis) framework Generating the pet-clinic schema in PostgreSQL Generating a Micronaut application for the pet-clinic microservice Defining a MyBatis factory Creating the entity classes Defining the mappers (repositories) for the entities Creating services for entities Performing basic CRUD operations Wrapping up Integrating with a NoSQL database (MongoDB) Creating a vet-reviews collection in MongoDB Generating a Micronaut application for the pet-clinic-reviews microservice Configuring MongoDB in Micronaut Creating the entity class Creating a data access repository Creating a service for the entity Performing basic CRUD operations Wrapping up Summary Questions Chapter 3: Working on RESTful Web Services Technical requirements Working on restful microservices in the Micronaut framework Using DTOs for the endpoint payloads Implementing DTOs Using MapStruct to define mappers Modifying the services to use DTOs Creating the restful endpoints for a microservice Creating an endpoint for retrieving a list of resources Creating an endpoint for retrieving a specific resource Creating an endpoint for inserting a resource Creating an endpoint for updating a resource Creating an endpoint for deleting a resource Using Micronaut's HTTP server APIs Binding HTTP requests in the Micronaut framework Validating data Handling errors Versioning the APIs Using Micronaut's HTTP client APIs Performing an HTTP PUT operation Performing an HTTP POST operation Performing an HTTP PUT operation Performing an HTTP DELETE operation Summary Questions Chapter 4: Securing the Microservices Technical requirements Working on RESTful microservices in the Micronaut framework The basics of Micronaut security Securing service endpoints using session authentication Implementing a basic authentication provider Configuring authorizations for the service endpoints Using JWT authentication to secure the service endpoints Setting up Keycloak as the identity provider Securing the pet-clinic microservice using token-based authentication Using OAuth to secure service endpoints Setting up Okta as the identity provider Enabling SSL in the Micronaut framework Securing the pet-clinic-reviews microservice using OAuth Summary Questions Integrating Chapter 5: Microservices Using Event-Driven Architecture Technical requirements Understanding event-driven architecture Event messaging or a pub/sub model in an event-driven architecture Event streaming in event-driven architecture Event streaming with the Apache Kafka ecosystem Integrating microservices using event streaming Setting up the Apache Kafka ecosystem locally Implementing an event-producer client in the pet-clinic-reviews microservice Implementing an event consumer client in the pet-clinic microservice Summary Questions Section 3: Microservices Testing Chapter 6: Testing Microservices Technical requirements Understanding the testing pyramid Unit testing in the Micronaut framework Unit testing using JUnit 5 Service testing in the Micronaut framework Integration testing using Testcontainers Setting up the Testcontainers in the Micronaut application Writing integration tests using Testcontainers Summary Questions Section 4: Microservices Deployment Chapter 7: Handling Microservice Concerns Technical requirements Externalizing the application configuration Using distributed configuration management to externalize the configuration Documenting the service APIs Using Swagger to document the pet-owner service endpoints Implementing service discovery Implementing service discovery using Consul Implementing the API gateway Implementing the API gateway service Implementing the fault tolerance mechanisms Leveraging built-in mechanisms Summary Questions Chapter 8: Deploying Microservices Technical requirements Building the container artifacts Containerizing the Micronaut microservices using Jib Deploying the container artifacts Using docker-compose to deploy the pet-clinic services Summary Questions Section 5: Microservices Maintenance Chapter 9: Distributed Logging, Tracing, and Monitoring Technical requirements Distributed logging in Micronaut microservices Setting up ELK in Docker Integrating Logstash with Micronaut microservices Verifying the distributed logging in the pet-clinic application Distributed tracing in Micronaut microservices Implementing distributed tracing in Micronaut Verifying the distributed tracing in the pet-clinic application Distributed monitoring in Micronaut microservices Setting up Prometheus and Grafana in Docker Configuring microservices for distributed monitoring Verifying the distributed monitoring in the pet-clinic application Summary Questions Section 6: IoT with Micronaut and Closure Chapter 10: IoT with Micronaut Technical requirements Basics of IoT Working on the basics of Alexa skills Basics of Alexa skills Basics of intents Your first HelloWorld Alexa skill Testing your code Integrating Micronaut with Alexa Summary Questions Chapter 11: Building Enterprise-Grade Microservices Technical requirements Bringing it all together Architecting enterprise microservices Planning and analysis Design Develop Deploy Manage and maintain Understanding Micronaut's OpenAPI Scaling Micronaut Implementing Micronaut's microservices Summary Questions Assessment Chapter 10 Chapter 11 Other Books You May Enjoy Index
Similar books
Building Microservices with Micronaut®: A quick-start guide to building high-performance reactive microservices for Java developers
2021 · EPUB
Radioisotopes - application in physical sciences
2011 · PDF
Radioisotopes - application in physical sciences
2011 · PDF
MySQL® Notes for Professionals book
2018 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
Session C11: Ancient Cultural Landscapes in South Europe – their Ecological Setting and Evolution, Session C22: Gardeners from South America, Session S04: Agro-Pastoralism and Early Metallurgy Sessions, Session WS29: The Idea of Enclosure in Recent Iberian Prehistory, Session C88: Rhytmes et causalites des dynamiques de l'anthropisation en Europe entre 6500 ET 500 BC: Hypotheses socio-culturelles et/ou climatiques: Proceedings of the XV UISPP World Congress (Lisbon 4-9 September 2006) / Actes du XV Congrès Mondial (Lisbonne 4-9 Septembre 2006) Vol.36
2010 · PDF
THE BRITISH ARMY IN INDIA: ITS PRESERVATION BY AN APPROPRIATE CLOTHING, HOUSING, LOCATING, RECREATIVE EMPLOYMENT, AND HOPEFUL ENCOURAGEMENT OF THE TROOPS. with AN APPENDIX ON INDIA : THE CLIMATE OP ITS HILLS ; THE DEVELOPMENT OF ITS RESODRCBS, INDUSTRY, AND ARTS ; THE ADMINISTRATION OF JUSTICE ; THE BLACK ACT ; THE PROGRESS OF CHRISTIANITY ; THE TRAFFIC IN OPIUM ; THE VALUE OF INDIA ; PERMANENT CAUSES OF DISAFFECTION, AND OF THE RECENT REBELLION ; THE TRADITIONARY POLICY; MISGOVERNMENT BY NATIVE RULERS ; ANNEXATIONS OF THEIR TERRITORY, ETC.
1858 · PDF