Introducing Load Balancer in Microservices architecture | OpenFeign | Spring Boot | Spring Cloud #4
Вставка
- Опубліковано 8 лип 2024
- In this lesson, we will learn to work with Netfilx’s Feign Client. OpenFeign is later adopted by spring cloud and became popular in java community. This lesson will walk you through a step by step process of building Feign clients and making rest api calls using it.
In our last lesson we understood micro-services communication using WebClient and RestTemplate. But the spring cloud’s open feign is going to be a go to approach in a java Microservices architecture as it will be easily compatible with other spring cloud’s project’s like eureka, spring cloud’s Loadbalancer , ribbon ,spring cloud gateway, etc. You will be understanding the same in the follow up lessons.
This video also let you know the importance of load balancer and will help you to Implement Client Side Load balancing in a Microservices architecture. We will use spring cloud’s ribbon as a load balancer in this video and, switching to spring cloud’s own load balancer from the next session onwards.
Looking for Guidance in Spring ?
Here are my Resources :
If you are new to Spring , please check my spring core, spring mvc, spring mvc intermediate, spring jdbc,spring security playlist on this channel.They all are FREE FULL COURSE and you need them as prerequisite.
If you already have some spring basics, You can take the below paid course on Spring Framework to enhance your skill set.
www.seleniumexpress.com/cours...
Time Stamp
------
00:00:00 - Netflix feign client introduction
00:06:18 - Setting up Spring boot app
00:15:21 - Building a FeignClient
00:20:25 - Making rest calls using FeignClient
00:36:42 - Q-How to deal with multiple Microservices calls ?
00:42:56 - Scaling up a Microservice
00:42:31 - QNA / Doubt Discussion
00:45:00 - The problem : Load Distribution
00:50:27 - Client Side Load Balancer
00:51:27 - Available Load Balancer API - Spring Cloud Vs Ribbon Load balancer
00:55:56 - Setting Up Ribbon
01:01:33 - Ribbon Client
01:04:06 - Load balancer in action
01:09:41 - Need of Service Discovery (coming Next)
01:13:33 - QNA/ Talks
#JavaMicroservices #SpringBoot #SpringCloud #LoadBalanceSpringBoot
This course will get you started with Microservices, for in-depth Microservices hands-on you can check out the below paid course : Course Name : Spring Boot Advanced + Microservices Bootcamp (Running Batch)Mode : Live / Self-Paced
www.seleniumexpress.com/cours...
#Microservices #SpringBoot #SpringCloud #java
For more free / paid courses visit
www.seleniumexpress.com
LINKS AND FREE LEARNING RESOURCES
========
Watch my new mock interview series for java developers
• Java interview questio...
Watch Spring boot Hot topics
• @Reposicotry Vs @Servi...
Java Interview / Question and Answer series
• Java collections inter...
Explain spring Bean Lifecycle
• REAL-TIME: Spring Bean...
spring core
• Spring framework tutor...
spring mvc
• Spring MVC course intr...
spring mvc intermediate
• [INTERMEDIATE] Spring ...
Spring JDBC
• Spring JDBC Course Pre...
spring live project
• #1 Build and Deploy A ...
SPRING SECURITY COURSE[NEW]
• Spring Security Course...
For more courses visit
www.seleniumexpress.com
Any time you are getting stuck with issues, Feel free to ask for support.
You can send mail to seleniumexpress@gmail.com
you can ping me on my Facebook page
/ seleniumexpress
Make sure to join my private Facebook page (Ask me here)
“SeleniumExpress - Support"
/ 187000222361579
you can ask for support in my website forum
www.seleniumexpress.com
Subscribe to my youtube channel
/ @seleniumexpress
Follow me on Insta
/ selenium_express
Abhilash, your effort in explaining this is unmatched. Engaging and easy to understand. The Best Spring Course out there!
The way you are teaching is fun , informative and a lot inspiring!
thanks a lot for great explanation, your way of adding clarifications in video makes it crystal clear, appreciate your effort !
If anyone can teach like you, that is only you,
Lots of informative, very deep explanation👏
Best explanation on youtube regarding the use of feign clients👏👏👏👌👌👌
your all videos are very very helpful
Feeling great, such wonderful explained
Excellent course. Congratulations!
Feeling Great!!🙇♂
Enjoy learning, happy to wait for next week lesson.
Thank you! See you next week.
thank you so much! I learnt about Feign Client and Ribbon, (load balancing)
amazing learning
you are such a great teacher man, keep it up pls
Your are teaching with good attitude, Inspiring..♥
very informative
Thanks sir
understood - thank you very much 🙏
Hi Abhilash, Thank you for Great explanation in easy way
UNDERSTOOD
Thank you
Feeling great
Thanks for such a great explanation
So nice of you !
Feeling Great
feeling great sir
Thanks sir for the video. Will be waiting for the next video
You are welcome! Sure, see you next Saturday 😊
Bro. Your presentation is top notch.
Thank you!
Waited whole day as you told Saturday you will be posting ❤️
Happy Learning, Himanshu ! ❤️
Thanks Abhilash sir ❤️
Thank you abilash, your videos are verry easy to understand, also this MS serious goint to be verry helpfull for me. I am waiting next videos as well. Keep it up. Your ammazing teacher.❤️❤️
Thanks for the kind words, Nuwan. Glad that my contents are helping.
Great video 👏🏽👏🏽
Thanks, Paridhi !
Love you sir it is from my heart
Thank you Manis ! It means a lot ❤️
Feeling great bro 👊👊👊
Thanks for the video
You are welcome, Santosh!
Feeling great 👍
❤️
Feeling great
Lots of love bro God bless you
❤️
Great Man😍
love you brother ❤️🙏🏻
❤️❤️😊
feeling great
understood
Thanks abhi ❤️
most welcome !
feeling grate
TQ
Feeling good
I will definitely buy this course if available on udemy because i cant wait 1 more week for next part.
I am not Udemy, you can checkout the full version of this course on seleniumexpress.com
@@SeleniumExpress yes sir i already checked. inr to pkr conversation for me course will be 26k pkr and I can't afford as i am a student.
@@JohnDoe-ej6vm do you have a university ICard? Give it to them, they will give you a student coupon if available. Happy Learning ❤️
Hi Abhilash,This was a great explanation and i have a doubt what if the restService is Protected with BasicAuth ??
bgm superrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Reminds me Retrofit in android development..
Hi Abhilash, a well explained video about load balancing.❤️❤️ I have one doubt so far , the feign client is great removing lots of boilerplate code but what about the exception handling or error handling in case of a 4xx or 5xx , do we need to handle all those in the service class from where we are calling the proxy or is there any way to define the exception handlings as well ??
Hi Manamohan !
Glad that it helped !
There are different ways to handle feign exception which will be covered in the follow up lessons. For now you can find an attribute called fallBackFactory inside @FeignClient.
Do a little research about that, it help you to override your feign client abstract methods and you can give a default fallback response / handle exception as per your need.
Alternatively you can use a global exception handler of spring and create an exception handler to handle feign client exceptions.
@ExceptionHandler(FeignException.class)
public String handleFeignException(FeignException e, HttpServletResponse response) {
//grab needed stuffs from the response
}
You can also learn about ErrorDecoder from feign. It will help you to decode the error response and handle exception as per your need.It's something like RestTemplate's ResponseErrorHandler if you are aware about .
Yes it makes sense now I was looking for something to replace the ResponseErrorHandler of rest template or to add fall back strategy with circuit breaker is in place . Thank you for the explanation ❤️❤️
Does entity framework return the same object reference if I query the "logically" (in database) same object from different places.
For example, I queried customer with name Joe Black, (and assume for now I know that there's only one Joe Black in the database.) Customer c = select ... blabla where ... Name == Joe Black...; and in somewhere else in the code, I queried Customer c2 = select... where.. ID==5 where 5 is the ID of Joe Black. I know that in the database they map to the same object, but DO they also map to the same object in code level? So does c1 equal to c2? I have lists to merge and check for logical equality of the objects (I cannot access the database for now) and I was wondering whether Entity Framework objects will play nicely with it or should I write my custom comparer classes.
waiting next video in the video series
Thank you for this wonderful course. I wonder how you would justified your paid students(incase they have queried you) of this batch that within a month or two you have uploaded this course for FREE for all of us :D .
Thanks sir :) you are really great person
Thanks for the kind words ❤️
Hi Avilashi, where to take the paid course for microservices @selenium express ? please lemme know..
In rest template - u told like it takes 10 sec to response back approximately
Is that won't happen in feign client?
What is the benefit of using client side load balancing over server side load balancing ? (I know its too early to ask) and why we are calling it client side although everything is on server ?
I have been looking into these topics from 10 days . I also have the same question . If anyone clear about this please answer
according to Browser security policy -> browser follows SOP(Same organ policy) if you want to access data from another ports/host browser doesn't allow us to do that, that's why we use crossOrigin but here in this video how it is happening. sir can you please explain this.
38:05 example
43:14 . Run Multiple instance in sts
One question that if Feign client also non blocking then why spring is just deprecating the rest template, it should also deprecate the feign client?
Does feign client supports spring oauth2 security features just like web client?
Yes, Kamal ! It's just a rest client.
if we are using REST protocols to communicate with other services that means this is just a distributed monoliths isn't it? please do a video on messaging queue based service communication.
Hi sir, i want to buy the full course but i didn't receive the confirmation mail in my mail id.can you please help me in this login process.
Can you cover unit testing cases???
Hi Deepak. I try to cover it in my 2nd batch of recordings. thank you for the suggestion.
Hi Abhilash. can you help me. I have error. It says : Consider defining a bean of type 'com.employee.employeeservice.service.AddressClient' in your configuration. It means even I make AddressClient a bean, using by @FeignClient annotation, but Spring can't find bean in IoC container. What to do?
O my God. Thanks> I resolved. Just I had to annotate main class with annotation @EnableFeignClients
How to feignClient fetch the url from application. Properties file..?
Hello Sir can u please start the Kafka and Apache camel series i really want to buy this series at any cost
Can any buddy tell me which IDE is the teacher using?
STS
hi bro please upload microservices coding part in github and tell us about github account of yours.
Could you please upload microservices paly list Abhilash
Hi Hari, please follow this playlist.
@@SeleniumExpress Thanks Abhilash i found play list.
please use diffrent database
feign client is not working for me
Hi Abhilash is this course available in Udemy???
Hi Rahul. No, I am not on Udemy !
It is like Modi ji's "Man ki Baat" rather than a good tutorial . He did not look forward even once during the entire period.
thank you so much! I learnt about Feign Client and Ribbon, (load balancing)
Thanks for the video
Welcome, Ravi!
Feeling great
feeling great
Feeling great
feeling great
feeling great
feeling great
I too. Glad to know that you have reached halfway
feeling great
😊