Page 1
Building Microservices with Spring Boot
Standard

Book: Building Microservices with Spring Boot

About year and a half/two years ago, I was in need of a new framework for developing standalone services and act as an HTTP interface to incorporate logic. The company I started working was strictly Java, and in my previous work, we were using Scala language with Play Framework. I was quite happy with Play Framework, but somehow I had the feeling, I need something way more flexible than Play. Also, Play Framework feels strange using in Java.

I was familiar with Spring CDI before, and to be honest, I find it terrible experience to manage dependencies with Spring and trying to chase an in issue with inconsistent dependencies. I was very(very) suspicious, but on the other hand, comments were good so I try it. I was very surprised by the simplicity, and I kept trying different modules to see when it is going to break. More I try it, more I started to realize that it is a good tool to build microservices.

Continue Reading →

more
Standard

Service Discovery : Choosing the Right Tool

You can most likely read hundred of blog posts, regarding which technology is good and which one is even better. The problem most often is that people who write about technology(that includes me as well), are approaching these topics subjectively. The result is the same problem can be solved by two people completely differently by using different technology stack and the method.

Continue Reading →

more
Standard

Nginx : Logging Request and Response Body Only on Failure

Recently, I had to track down some bugs which were happening in the current system that I am working on. The problem was, the issue was occurring enough to raise the flags, but could not reproduce very easily. The system I am currently working on it has dozens of HTTP application, and it is not easy to track down the exact origin of the problem. We are stashing our logs in elastic search, and over kibana it was visible that users were receiving HTTP 500 – Internal Server Error. After getting exhausted, I want it to tap into the HTTP communication and get more detail, so at least, I can identify the issue.

Nginx is in front of all services, so it would be a relatively easy trick. But that meant logging request and response body of every request, which are unnecessary, so the natural question came into mind was “Can I log request and response body of failures only?

Continue Reading →

more
Standard

API Throttling to Protect Your Resources

Throttling is the intention of giving limited usage to an available resource you have in your hand. For instance, if you are exposing your API to be used publicly, you may want to limit the usage of the API because of expensive computation, limited resource or simply a financial motive such as the monthly cost for X amount of request. Therefore, you may need to build some kind of API Throttling, which limits the incoming request based on defined criteria.

Continue Reading →

more
Standard

Correlation ID

A Correlation ID refers to an ID that uniquely links discrete events together across different services, which has a single origin. For instance, a single user action, such as ordering an item, could generate multiple service calls. The following diagram gives an example of this, a user orders an item, and different events are propagated through the system. These events are all linked to a single user action, and each service is responsible for completing its task.

Continue Reading →

more