Posts

Showing posts from January, 2021

Spring Cloud Stream - Publish Message to RabbitMQ

Image
 Spring cloud stream is a framework for building highly scalable event-driven microservices connected with shared messaging systems. It uses the Spring Integration project to provide connectivity to a message broker. It unifies lots of popular messaging platforms behind one easy to use API including RabbitMQ, Apache Kafka, Google PubSub etc..Without this framework, we will be writing lot of boilerplate codes to support different messaging platform, and it will go beyond maintainable.  Spring Cloud Stream relies on the concept of binder to handle the integration with a messaging or event streaming framework. The binders support the core feature of modern messaging/eventing systems, such as  Publish/Subscribe, Consumer Groups, Partitioning, Message-driven consumers, Polling based consumers.  Let's see some of the concepts, before we jump into the code Binder:  A binder handles the integration with single framework. This abstraction allows your code to be middlewar...

What is Terraform?

Image
 Terraform is a free and open source Infrastructure as code software tool created by HashiCorp. A declarative coding tool, Terraform enables developers to use a high-level configuration language called HCL(HashiCorp Configuration Language) to describe the "end-state" cloud or on-premises infrastructure for running application. One of the biggest advantage of Terraform is it's ability to deploy infrastructure across multiple platforms including private and public cloud, such as on-premise vSphere cluster or cloud solutions such as AWS, GCP or Azure, these are just a few of the many resources that Terraform can manage. Terraform supports lots of providers, hence can work with almost every infrastructure platform. You can download the respective binary from the following download link. All infrastructure resources can be defined within configuration files that has a .tf file extension. The configuration syntax is easy to read, write and pick up for a beginner. Below is the ...

Spring Boot - Eureka Server

Image
 Microservices communicate with each other through exposed endpoints. For this communication to take place the dependent service should know the address of the other microservice to invoke its endpoint through a REST call, to get its job done.  Traditionally, all these endpoints has been hardcoded in configuration properties of the respective system.  However, with dynamic scaling of services in place it become hard to keep track of their address every time a new instance was created or destroyed. To overcome this problem, we use Eureka servers. It contains a registry of services and a REST API that can be used to register a service, deregister a service, and discover the location of other services like running port and IP address. All of this happens dynamically as soon as the instance of the service comes up or is destroyed. Eureka comes with two components - Eureka Client and Eureka Server . Eureka Server Keeps a record of all the services which have registered. Enabl...