Spring Boot 2.0 Projects
eBook - ePub

Spring Boot 2.0 Projects

Build production-grade reactive applications and microservices with Spring Boot

Mohamed Shazin Sadakath

  1. 336 pages
  2. English
  3. ePUB (adapté aux mobiles)
  4. Disponible sur iOS et Android
eBook - ePub

Spring Boot 2.0 Projects

Build production-grade reactive applications and microservices with Spring Boot

Mohamed Shazin Sadakath

DĂ©tails du livre
Aperçu du livre
Table des matiĂšres
Citations

À propos de ce livre

Develop diverse real-life projects including most aspects of Spring Boot

Key Features

  • Run production-grade based applications using the Spring WebFlux framework
  • Learn to develop high performance, asynchronous applications with Spring Boot
  • Create robust microservice-based applications with Kotlin using Spring Boot

Book Description

Spring is one of the best tools available on the market for developing web, enterprise, and cloud-ready software. The goal of Spring Boot is to provide a set of tools for quickly building Spring applications that are easy to configure, and that make it easy to create and run production-grade Spring-based applications. Spring Boot 2.0 Projects will get you acquainted with important features of the latest version of this application-building tool and will cover basic, as well as advanced topics.

The book starts off by teaching you how to create a web application using Spring Boot, followed by creating a Spring Boot-based simple blog management system that uses Elasticsearch as the data store. As you make your way through the chapters, you'll build a RESTful web services application using Kotlin and the Spring WebFlux framework. Spring WebFlux is a new framework that helps in creating a reactive application in a functional way. Toward the end of the book, you will build a taxi-hailing API with reactive microservices using Spring Boot and a Twitter clone with a Spring Boot backend. Finally, you'll learn how to build an asynchronous email formatter.

What you will learn

  • Learn the fundamental features of Spring Boot 2.0
  • Customize Spring Boot 2.0 applications
  • Build a basic web application
  • Use Redis to build a taxi-hailing API
  • Create a simple blog management system and a Twitter clone
  • Develop a reactive RESTful web service with Kotlin using Spring Boot

Who this book is for

This book is for competent Spring developers who wish to understand how to develop complex yet scalable applications with Spring Boot. You must have a good knowledge of Java programming and be familiar with the basics of Spring.

Foire aux questions

Comment puis-je résilier mon abonnement ?
Il vous suffit de vous rendre dans la section compte dans paramĂštres et de cliquer sur « RĂ©silier l’abonnement ». C’est aussi simple que cela ! Une fois que vous aurez rĂ©siliĂ© votre abonnement, il restera actif pour le reste de la pĂ©riode pour laquelle vous avez payĂ©. DĂ©couvrez-en plus ici.
Puis-je / comment puis-je télécharger des livres ?
Pour le moment, tous nos livres en format ePub adaptĂ©s aux mobiles peuvent ĂȘtre tĂ©lĂ©chargĂ©s via l’application. La plupart de nos PDF sont Ă©galement disponibles en tĂ©lĂ©chargement et les autres seront tĂ©lĂ©chargeables trĂšs prochainement. DĂ©couvrez-en plus ici.
Quelle est la différence entre les formules tarifaires ?
Les deux abonnements vous donnent un accĂšs complet Ă  la bibliothĂšque et Ă  toutes les fonctionnalitĂ©s de Perlego. Les seules diffĂ©rences sont les tarifs ainsi que la pĂ©riode d’abonnement : avec l’abonnement annuel, vous Ă©conomiserez environ 30 % par rapport Ă  12 mois d’abonnement mensuel.
Qu’est-ce que Perlego ?
Nous sommes un service d’abonnement Ă  des ouvrages universitaires en ligne, oĂč vous pouvez accĂ©der Ă  toute une bibliothĂšque pour un prix infĂ©rieur Ă  celui d’un seul livre par mois. Avec plus d’un million de livres sur plus de 1 000 sujets, nous avons ce qu’il vous faut ! DĂ©couvrez-en plus ici.
Prenez-vous en charge la synthÚse vocale ?
Recherchez le symbole Écouter sur votre prochain livre pour voir si vous pouvez l’écouter. L’outil Écouter lit le texte Ă  haute voix pour vous, en surlignant le passage qui est en cours de lecture. Vous pouvez le mettre sur pause, l’accĂ©lĂ©rer ou le ralentir. DĂ©couvrez-en plus ici.
Est-ce que Spring Boot 2.0 Projects est un PDF/ePUB en ligne ?
Oui, vous pouvez accĂ©der Ă  Spring Boot 2.0 Projects par Mohamed Shazin Sadakath en format PDF et/ou ePUB ainsi qu’à d’autres livres populaires dans Computer Science et Programming in Java. Nous disposons de plus d’un million d’ouvrages Ă  dĂ©couvrir dans notre catalogue.

Informations

Année
2018
ISBN
9781789134223
Édition
1

Building an API with Reactive Microservices

This chapter will help readers get started on developing reactive microservices using Spring Boot 2.0. It will enable experts as well as beginners in Spring Boot web application development to understand the concepts behind a microservice and how easy it is to use Spring Boot 2.0 to develop a microservice application. It will explain these concepts by walking the reader through the process of developing two microservices related to a Taxi Hailing System, where one will be for the Taxi Service, including functions such as getting available taxis, finding the status of a taxi, updating taxi location, and registering taxis, and the other one will be for the Taxi Booking Service, which will allow users to book a taxi, cancel a taxi, and so on. These two microservices will be running inside a container platform named Docker and will use a Redis instance for persistence, Spring Data Redis Reactive for the model and repository, and Spring WebFlux for controllers.
The following topics will be covered in this chapter:
  • Using Spring Data Redis for persistence
  • Using Spring WebFlux for controllers
  • Using asynchronous data transfer for cross-microservice communication
  • Using Docker to support microservices
  • Demonstrating Saber

Technical requirements

In order to implement the web application using Spring Boot, the following build tools need to be downloaded and installed:
  • To install Java Development Kit (JDK) 8, download it from its official page at http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
  • To install Maven 3, download it from its official page at https://maven.apache.org/download.cgi
  • To install IntelliJ IDEA, download it from its official page at https://www.jetbrains.com/idea/download/
  • To install Spring Tool Suite (STS), download it from its official page at https://spring.io/tools
  • To install Docker, download it from its official page at https://www.docker.com/get-docker
The source code for this chapter can be found at https://github.com/PacktPublishing/Spring-Boot-2.0-Projects-Fundamentals-of-Spring-Boot-2.0, under the Chapter06 directory.

Getting started

In this section, the reader will get an overview of the reactive microservices being developed. The requirements, design, and implementation details will be discussed in brief.

Microservices architecture

Microservices architecture has become a buzzword within the last five years with the emergence of cloud-based hosting services. There is no fixed definition of this architecture, but in general terms, microservices architecture is a way of designing and implementing software as a collection of independently deployable services that are highly coherent and loosely coupled. Each of these services will be designed, implemented, deployed, and maintained by a team of usually 5 to 10 members with complete ownership and accountability. Each microservice will address a particular domain of a system (user, sales, and others), can be developed using different programming languages, and can have its own persistence and an API to enable synchronous communication and/or a publisher/subscriber model for asynchronous communication.
Microservices architecture was preceded by monolithic architecture, where all the functionality was grouped into a single application that loaded and ran inside a single process. This monolithic software was really heavy and took a lot of time to load, and scaling required the entire application to be scaled by replicating it in multiple servers. There was no way to scale a particular functionality alone. This is depicted in the following diagram:
Microservices architecture addressed these pain points by enabling us to run small, highly cohesive applications that do one functionality really well. This could load fast and require fewer resources to function. Scaling of a microservice can be done by distributing it across servers and by replicating it as and when needed. Consider the following diagram:
There are some characteristics that can be found in any Microservices architecture-based software application, which are as follows:
  • Service components: The components in a microservice architecture are services that can communicate via a web request, RPC call, and so on. Unlike library components in a monolithic application where communication happens between library components via in-memory, in-process calls internally without an external API.
  • Organized by business domain: In a monolithic application, l...

Table des matiĂšres

Normes de citation pour Spring Boot 2.0 Projects

APA 6 Citation

Sadakath, M. S. (2018). Spring Boot 2.0 Projects (1st ed.). Packt Publishing. Retrieved from https://www.perlego.com/book/778073/spring-boot-20-projects-build-productiongrade-reactive-applications-and-microservices-with-spring-boot-pdf (Original work published 2018)

Chicago Citation

Sadakath, Mohamed Shazin. (2018) 2018. Spring Boot 2.0 Projects. 1st ed. Packt Publishing. https://www.perlego.com/book/778073/spring-boot-20-projects-build-productiongrade-reactive-applications-and-microservices-with-spring-boot-pdf.

Harvard Citation

Sadakath, M. S. (2018) Spring Boot 2.0 Projects. 1st edn. Packt Publishing. Available at: https://www.perlego.com/book/778073/spring-boot-20-projects-build-productiongrade-reactive-applications-and-microservices-with-spring-boot-pdf (Accessed: 14 October 2022).

MLA 7 Citation

Sadakath, Mohamed Shazin. Spring Boot 2.0 Projects. 1st ed. Packt Publishing, 2018. Web. 14 Oct. 2022.