Skip to main content

Posts

Showing posts from April, 2020

Microservices with Spring Boot - complete tutorial

In this tutorial we are going to learn how to develop microservices using spring boot with examples. Main focus of this tutorial is on learning by doing hands-on. Before hands-on we will first understand what is microservices and related terminologies like DDD, 12-Factors App, Dev Ops.
What is a Microservice In simple terms microservice is a piece of software which has a single responsibility and can be developed, tested & deployed independently. In microservices we focus on developing independent and single fully functioning modules.
Opposite to microservice, with monolithic application it focuses on all the functionality or modules in a single application. So when any changes required to monolithic application it has to deploy and test the complete application while with microservice it has to develop and deploy only affected component which is a small service. It saves lot of development and deployment time in a large application.
It's basically an architectural style whic…

Microservices - Spring cloud API gateway along with registry server

Here we will learn, how to create API gateway using Spring cloud API. We will also register it with discovery/ registry server. Also will see how to access microservice using registry server through API gateway.
What is API gateway As its name implies, API gateway is the single entry-point to an application or system. It can handle a request and invoke the appropriate service registered with it. It provides many features like protocol translation, filtering, security, interceptors etc. Using API gateway we can invoke any microservice whether its direct invocation or using some registry/ discovery server to invoke registered services using their ID.
Creating API gateway In our example we will create an API gateway which will register itself with Eureka discovery server and will invoke the microservice available in discovery server using its registered service ID.
API gateway can be implemented two ways, one is using Zuul proxy and second is using spring cloud API gateway. Difference b…

Microservices - Service Registration/ discovery using Spring boot and Eureka

In this tutorial we will learn how to create registry/ discovery server using Eureka and Spring boot. We will register our Rest microservice with this registry server which can be discovered by client by connecting to registry server.
What is registry/ discovery server We can assume registry or discovery server as a central place where we can find all our microservices using their registered IDs with discovery server. Microservices register themselves in registry server and client applications access them using a single registry or discovery server. It is similar to a phone directory but provides many other useful features.
If we don't user registry server then we need host name and endpoint details to access a service. In today's era most of the services are deployed in cloud and using cloud features like auto-scaling where network addresses are updated dynamically and we can't use a simple network address for that. Now when we use registry server, then such microservice…