Posts
Spring Under the hood-Inside Feign and client side discovery with consul
Feign using consul as discovery service is easy to setup thanks to Spring Autoconfigurations, but let’s see how this magic is actually done -
Spring cloud open feign comes with FeignLoadBalancerAutoConfiguration . If we see closely it imports three more LoadBalancerAutoConfigurations
HttpClientFeignLoadBalancerConfiguration, OkHttpFeignLoadBalancerConfiguration, DefaultFeignLoadBalancerConfiguration
If classpath has Apache http client then it uses HttpClientFeignLoadBalancerConfiguration , if path has Ok http client then it uses OkHttpFeignLoadBalancerConfiguration otherwise uses it DefaultFeignLoadBalancerConfiguration which in turn uses Apache Http client.
Posts
Provisioned Concurrency
AWS Lambda is the serverless offering from amazon. In serverless the provider is responsible for settung up a runtime as and when needed for the deployed application/function to run. Typically these are small functions which are quick to start up and finish their task. Lambdas when invoked, has a small startup overhead. This startup overhead involves fetching the function artifact from S3 , setting up networking, starting up the application. Java applications often suffer from this cold start up problem , and depends on application this can go up quite a bit.
Posts
Spring Boot Liveness
Spring Boot Actuator Health endpoint since 2.3.0 comes with two health groups Liveness and Readiness. Actuator Health points are being used to reflect the status of the application. Spring Boot also provides a way to add multiple health indicators together and form a group. As a continuation to this concept Spring Boot provides two HealthIndicator LivenessStateIndicator and ReadinessStateIndicator. These two indicators are added to liveness and readiness group respectively by AvailabilityProbesHealthEndpointGroups.
Posts
Deploy EKS Kubernetes Cluster with fargate
EKS is managed kubernetes service by AWS. This post will describe networking setup for EKS cluster.
EKS have two options public cluster and private-public cluster. In the public cluster all nodes get a public IP and they can access internet traffic and vice versa.
In public-private scheme nodes are all in private subnet and services are exposed via Loadbalancers in public subnet.
We will see network configuration about public-private scheme. Below is the conceptual design of the cluster
Posts
AWS Fargate Task Networking
In order to explore more about deploying on ECS using terraform and github action I created a small project but as I try to deploy it on AWS ECS I found some interesting issue.
So I created a services in a subnet , the subnet has rule that route all internet traffic to an internet gateway. The service has a simple task. I created all the infrastructure using terraform and deployed using github.
Posts
Traceid Logging with Micronaut
Distributed tracing is must have when we create our microservices . Frameworks like Spring Boot,Micronaut comes with the support of creating TraceId,SpanId and propagate to visualization tools like Zipkin,Jaegar . This post shortly describe what we need to add in order to log the TraceId in application or access log . Logging traceId helps us in correlating the logs . For logging I have used Slf4j with logback . In micronaut support for generating TraceId comes quite easily just matter of adding proper dependencies which can be found here https://guides.