Posts

Showing posts from April, 2016

Centalized Log Analysis & Processing

Image
Logging is always being considered as a fundametal and inherent part of any application, irrespective of the language and platform chosen. By the question arises that "Why Logs are very important???" Beacause I think it is the logs that help us get the real time impression of our application behaviour, i.e the user stimulus, the system responding to it, all the data that are being acted upon etc. In a word the I can say not only the Lifecycle of the application but the human interactions too gets recorded while logging. So Logging is basically the process of recording application actions and state. The stream of events that gets captured while logging becomes a very important source of application's current state and the state to which it needs to be evolved. Today Logging becomes the source of data analytics and data mines are emerging out from it which is helps us to make the application behave in a more intelligent manner. But for all these to happen, we

Spring Cloud - The Final FALLBACK

Image
Yes, the POST name The Final FALLBACK is absolutely inline with what we will discuss here. We are talking about HYSTRIX-THE CIRCUIT BREAKER , which provides the FALLBACK functionality in Microservices architecture. The Code can be accessed at GITHUB Hystrix - The Circuit Breaker: The fallback mechanism is one of the most prominent and important partner in a microservice landscape and it can be implemented with Hystrix in Spring Ecosystem. The vivid documentation can well be found at the official Site. Here is the basic implementation of Circuit Breaker with Hystrix. Our architectural landscape is almost similar to the following: The incoming request first arrives at the “GATEKEEPER”(ZUUL has also got RIBBON) , which routes it to the Feign Client, which is both “HYSTRIX” and “RIBBON” enabled. The “RIBBON” does the Load Balancing work smartly, and which we can see in action, if more than one instance of the service (here AUTH-SERVICE) is being deployed. Now,

Spring Cloud - Part 3

Image
This post will be dedicated to Centralized Configuration Management for Microservices architecture. The Codebase is present at GITHUB Spring-Cloud-Config: Spring Cloud Config provides us a Centralized way of managing configuration details or properties for different services. Other services can refer to this service for managing their configuration. The Starter Class looks like: @SpringBootApplication @EnableEurekaClient @EnableConfigServer public class ConfigStarter { public static void main(String[] args){ SpringApplication.run(ConfigStarter.class, args); } } We have defined configuration for our AUTH-SERVICE only. However we can define configuration properties for any number of services we like. Within src/main/resources we have defines config folder and define two properties file: 1) auth-service.yml 2) auth-service-dev.yml The first property file will be referred by AUTH-SERVICE when it was initialized in default profile, and the second

Spring Cloud - Part 2

Image
Clients are such an important part of any business architecture, because it is for them all the services are meant and we remain always committed in fulfilling their ends, and if they provide an easy interface to interact with them, then sure I cannot ask for more. To access the microservices, we either use: 1. Restemplate based client 2. Feign Based client. We will discuss both of them here. I have uploaded my code base at GITHUB When talking about clients that can access the services rather microservices registered in Eureka, the first approach we have taken is with “RESTTemplate” . The RESTTemplate that we have used (rather injected) in Spring-Cloud-Client is auto configured by Spring Cloud and uses Netflix Ribbon to do the micro-service lookup. Ribbon is the software based load balancer implemented at the client side helps to pick a microservice based on service-name (as registered with the Eureka) specified with the property: spring

Spring Cloud

Image
Hi Friends!!!, It has been really long since last I wrote for Spring HATEOAS , and along with that I really want to apologize for not completing it and soon I am going to post all my finding on that. But before going into that I thought why not Refurbish ourseleves with something new, something really interesting. Here it is, Spring Cloud Spring is always considered as an onestop need for all the requirements, and when I say that I mean in each and every aspect, which makes Spring essentially an ecosystem. Spring Cloud is no exception to that. Spring Cloud provides tools for developers to quickly build some of the common patterns in distributed systems. 1) configuration management 2) service discovery 3) circuit breakers 4) intelligent routing 5) micro-proxy 6) control bus 7) one-time tokens 8) global locks 9) leadership election 10) distributed sessions 11) Cluster state. With the MICROSERVICES gaining popularity at a fast pace, becau