simple, to the point . You are helping me find my confidence. Always great to see your tutorials. Have used your tutorials in major productions aswell. as POC ofcourse :)
Hi Koushik, I am following the same approach taught by you in the video, but i get "Connection Timed out" error and I am using Spring Boot v2.2.2 RELEASE. Also, there is a difference in the URL generated for each client in the console of eureka Dashboard. For eg: host.docker.internal:movie-catalog-service:8081. Could you please help in this case?
But you need to use the Load Balanced Eureka Server 8761 port to hit the service. At 4:41 There is no use of hitting the URL directly to demonstrate the working.
How do you access this URLs in the browser, does they work with Eureka server because now their is still a dependancy if I need to call them from frontend.
Hi Kaushik Thanks for the Tutorial , Have a question how does service discovery happen across different clusters or different servers (in qa or prod env where we have different physical servers )
Question: When/How frequently does a service(also a Eureka client) query the addresses of other services it might need? One thing I found out is: If service A needs service B's response to construct its response, service B must be started and register himself to Eureka before service A. Otherwise service A will throw exception: "No instances available for B"
Jiayi Lei So are you explaining about the order in which the services need to be started ? . If we start the services randomly we can't guarantee that all the services will work is what you wanted to say right
@@bogalaharish Right. I found Eureka Client contacts Eureka Server on start and do it again about every 30 seconds(there must be a property defines this). So if I started a service that depends on other services first, then others. In the first 30 seconds, this service will have trouble knowing other services' addresses, since by then Eureka server list is empty. But after you started all services, and 30 seconds later, every service will work fine.
I tried the tutorial and it worked perfectly as long as embedded tomcat is there. Now i tried everything on external tomcat(9), my services are not able to communicate with each other. Every time i get error, connection refused. Kaushik can you please help in this ?
Hi, I am getting connectException when I introduced LoadBalanced and try to connect service through RestTemplate with a particular name as shown in the video. Can anyone help?
Hey There, I'm bit confused about the Service discovery part, if we deploy the microservices in Kubernetes , we can create services right and that can handle all these service discovery problems and Loadbalancing issues. So should we still use Eureka tool even if you deploy our services in kubernetes?
Hi, How does Eureka server publish all those URLs without writing a single line of coding in the DiscoverServer project? If I am having another eureka server with a different name than what will happen.
Best Microservices tutorial so far! I will continue with the courses you have on your website. Just a question: Any Reason the Eureka Server is formatting my output? Before I implemented the Eureka Server output had variable names etc. Now it returns just variables, without names, all mashed up in one block withous spaces or anything. Any idea where should i look for the reason? Thank you!
If you want to get JSON response , just add produces = { "application/json", "application/json"} argument to the @Requestmapping annotation in the MovieCatalogResource controller.
As i added @loadBalanced annotation i am getting below error java.lang.IllegalStateException: No instances available for localhost at org.springframework.cloud.netflix.ribbon.RibbonLoadBalancerClient.execute(RibbonLoadBalancerClient.java:105) ~[spring-cloud-netflix-ribbon-2.1.0.RELEASE.jar:2.1.0.RELEASE] on the eureka dashboard, i am seeing all services are up, if I removed @LoadBalanced annotation service worked fine whats wrong with this annotation please any one help me?
Hello Sir, Thank you so much for your valuable time making such a wonderful session on Microservices. One query : We can achieve load balancing using Ribbon, what is difference between load balancing using Eureka and Ribbon. How it differs?
@@divyamohan6113 just after commenting I got the solution. If you are running on localhost Add below property for all Eureka clients in application.properties eureka.instance.hostname=localhost
Try add in application properties in eureka client this --> eureka.instance.prefer-ip-address=true When you use RestTemplate or WebClient with @LoadBalanced work with this property(not work when you call in browser, I don't know why)
@@damianmorawski2440 It still doesn't work with me. Any ideas why? I have the @LoadBalanced annotation and the eureka.instance.prefer-ip-address=true W
Did you add @LoadBalanced in the correct place. Because in my case I was adding that before WebclientBuilder and so it was not working for me. Now after moving it before RestTemplate it is working fine.
@@kavyaramachandran9501 Yes, I am adding it before the RestTemplate and it's still not working. No idea why. I am trying to fix it for three days and still no result.
For those who are getting error UnknowHostException : No host for service :- movie-info-service , you need to add the @LoadBalanced annotation for the bean of WebClient.Builder also
I am running into the error "java.lang.IllegalStateException: No instances available for movie-rating". I have double and triple checked the spelling of the name that I have provided in the application.properties file. I do see these instances in the eureka service. I have also tried giving eureka.instance.hostname=localhost and also tried eureka.instance.prefer-ip-address=true. I have @EnableEurekaClient on the main class and @LoadBalanced for RestTemplate. Still getting this error message. Anyone faced this issue and resolved it? Thanks for any assistance provided.
All the services should be running at the same time and server needs to be up too. Please refresh and try again. Don't forget to check the (registered) services name in the URLs itself.
Hi!! When I add to the pom.xml the dependencies.. Eureka Server recognizes the Service without setting the annotation @EnableEurekaClient.. Why does it happen?
After your answer I searched and found "Then we need to annotate a @Configuration with either @EnableDiscoveryClient or @EnableEurekaClient - note that this annotation is optional if we have the spring-cloud-starter-netflix-eureka-client dependency on the classpath."
simple, to the point . You are helping me find my confidence. Always great to see your tutorials. Have used your tutorials in major productions aswell. as POC ofcourse :)
One of the best microservice tutorials I have ever seen. Thanks, Kaushik.
best microservice tutorial. what makes it best is just enough code to make you realize stuff.
Excellent! You are definitely in the top three teachers that I ever came across. 👍
Who are other 2?
@@neeket7048 probably 2 more instances of Kaushik..himself ;)
@@neeket7048 probably 2 more instances of Kaushik himself. ;)
you are so good at explaining its unreal. good job! Your effort matters and is helping people out there, me included!
Wow! Thank you! You managed to explain so simply! Keep doing this!
Hi Koushik,
I am following the same approach taught by you in the video, but i get "Connection Timed out" error and I am using Spring Boot v2.2.2 RELEASE. Also, there is a difference in the URL generated for each client in the console of eureka Dashboard. For eg: host.docker.internal:movie-catalog-service:8081. Could you please help in this case?
Getting the same error
getting same error
getting same error...was anyone able to fix it?
can you please make more advance course on api gate way, histrix, security
thank you so much sir. i have implemented all things as per your guidelines and it works properly.
It will work if my services run on wildly?
But you need to use the Load Balanced Eureka Server 8761 port to hit the service. At 4:41 There is no use of hitting the URL directly to demonstrate the working.
Thank you so much 🙏🏽
Did anyone encounter 404 null error while running the movie-catalog-service?
If you have 100 services you need to create 100 different servers to register the services???
Just 1 server is required to register "N" number of services.
How do you access this URLs in the browser, does they work with Eureka server because now their is still a dependancy if I need to call them from frontend.
Can we use the same url for movie catalog service as well? As a port for the movie catalog service is hard-coded.
Wow it's really amazing !
Hi Kaushik Thanks for the Tutorial , Have a question how does service discovery happen across different clusters or different servers (in qa or prod env where we have different physical servers )
How Eureka client will understand to which service discovery it has to register if there are more than one Eureka Servers in application?
Question: When/How frequently does a service(also a Eureka client) query the addresses of other services it might need?
One thing I found out is: If service A needs service B's response to construct its response, service B must be started and register himself to Eureka before service A. Otherwise service A will throw exception: "No instances available for B"
Jiayi Lei So are you explaining about the order in which the services need to be started ? . If we start the services randomly we can't guarantee that all the services will work is what you wanted to say right
@@bogalaharish Right. I found Eureka Client contacts Eureka Server on start and do it again about every 30 seconds(there must be a property defines this). So if I started a service that depends on other services first, then others. In the first 30 seconds, this service will have trouble knowing other services' addresses, since by then Eureka server list is empty. But after you started all services, and 30 seconds later, every service will work fine.
i am facing Connection timeout issue after adding @LoadBlanced
Hi, thanks a lot for your explanation, please where we can find the code of the lessons?
What would happen if the service is down? How does Eureka deregister the service?
I tried the tutorial and it worked perfectly as long as embedded tomcat is there.
Now i tried everything on external tomcat(9), my services are not able to communicate with each other.
Every time i get error, connection refused.
Kaushik can you please help in this ?
Hi, I am getting connectException when I introduced LoadBalanced and try to connect service through RestTemplate with a particular name as shown in the video. Can anyone help?
Hey There,
I'm bit confused about the Service discovery part, if we deploy the microservices in Kubernetes , we can create services right and that can handle all these service discovery problems and Loadbalancing issues.
So should we still use Eureka tool even if you deploy our services in kubernetes?
What about webClient usage?
Load balanced annotation works only for rest template.
The same @LoadBalanced annotation works for the WebClient bean too. Same effect.
amazing tutorial
I think Spring is a direct gift from God to mankind...
Yes it is.. ♥️
And mr. Kaushik too
Error creating bean with name 'scopedTarget.eurekaClient' defined in class path resource
can some please helpme this error is with movie info project
if you see no code error and you did the coding right but still not loading the page, do an "Empty cache and hard reload"
Keep up your good work sir 👍
Hi, your videos are great source of learning, I was wondering how to consume that service on ajax or out of rest template?, plz help in this regard
Hi,
How does Eureka server publish all those URLs without writing a single line of coding in the DiscoverServer project?
If I am having another eureka server with a different name than what will happen.
localhost:9090/catalog/foo
Post creating dicovery server in start.spring.io, when i tried to import the project its POM file is showing error in schemaLocation
If say we are calling another api which is not a microservie. then also after using the @Loadbalanced Eureka will do the load balancing for that API?
Best Microservices tutorial so far!
I will continue with the courses you have on your website.
Just a question:
Any Reason the Eureka Server is formatting my output?
Before I implemented the Eureka Server output had variable names etc.
Now it returns just variables, without names, all mashed up in one block withous spaces or anything.
Any idea where should i look for the reason?
Thank you!
Im getting in xml format now, I use spring cloud commons dependency is it becouse of that?
If you want to get JSON response , just add produces = { "application/json", "application/json"} argument to the @Requestmapping annotation in the MovieCatalogResource controller.
Thanks for tutorials
while consuming how does it know eureka server port
It tries to connect with default server port 5761.
@@AshokDhulipalla Port 8761
As i added @loadBalanced annotation i am getting below error
java.lang.IllegalStateException: No instances available for localhost
at org.springframework.cloud.netflix.ribbon.RibbonLoadBalancerClient.execute(RibbonLoadBalancerClient.java:105) ~[spring-cloud-netflix-ribbon-2.1.0.RELEASE.jar:2.1.0.RELEASE]
on the eureka dashboard, i am seeing all services are up,
if I removed @LoadBalanced annotation service worked fine
whats wrong with this annotation please any one help me?
You need to replace localhost:port with the service name while consuming.
How to discover service by using web client?
How to configure If it’s SSL enabled tomcat?
Hello my friend, i like your videos, i need your help, is recommended to udrt Eureka Server and Zuul Proxy Server in the same application,
Hello Sir,
Thank you so much for your valuable time making such a wonderful session on Microservices.
One query : We can achieve load balancing using Ribbon, what is difference between load balancing using Eureka and Ribbon. How it differs?
I/O error on GET request for
Did you get the solution ?
@@Amansingh-te6ju no
@@divyamohan6113 just after commenting I got the solution. If you are running on localhost
Add below property for all Eureka clients in application.properties
eureka.instance.hostname=localhost
Adding @EnableEurekaClient on main class worked for me
I have a debt with API gateway ? can you explained me in comment?
Thanks a ton sir. :)
Thanks man !
THat annotation @Load Balancing OMG... I was trying to solve an error of unknown host exception. After watching this video it was solved...
Excellent! Can you put the subscript for your videos?
java.net.UnknownHostException: movie-rating-service
EVEN AFTER ADDING @LoadBalanced
Have you solved it? I have same issue for ratings-data-service .
Try add in application properties in eureka client this --> eureka.instance.prefer-ip-address=true
When you use RestTemplate or WebClient with @LoadBalanced work with this property(not work when you call in browser, I don't know why)
@@damianmorawski2440 It still doesn't work with me. Any ideas why? I have the @LoadBalanced annotation and the eureka.instance.prefer-ip-address=true
W
Did you add @LoadBalanced in the correct place. Because in my case I was adding that before WebclientBuilder and so it was not working for me. Now after moving it before RestTemplate it is working fine.
@@kavyaramachandran9501 Yes, I am adding it before the RestTemplate and it's still not working. No idea why. I am trying to fix it for three days and still no result.
For those who are getting error UnknowHostException : No host for service :- movie-info-service , you need to add the @LoadBalanced annotation for the bean of WebClient.Builder also
I am running into the error "java.lang.IllegalStateException: No instances available for movie-rating". I have double and triple checked the spelling of the name that I have provided in the application.properties file. I do see these instances in the eureka service. I have also tried giving eureka.instance.hostname=localhost and also tried eureka.instance.prefer-ip-address=true. I have @EnableEurekaClient on the main class and @LoadBalanced for RestTemplate. Still getting this error message. Anyone faced this issue and resolved it? Thanks for any assistance provided.
Hi, did you find a solution for this?
All the services should be running at the same time and server needs to be up too. Please refresh and try again. Don't forget to check the (registered) services name in the URLs itself.
Wow it's really amazing !
Hi!! When I add to the pom.xml the dependencies.. Eureka Server recognizes the Service without setting the annotation @EnableEurekaClient.. Why does it happen?
he said that annotations is optional now.
@@osvaldoleiva678 Thansk... Great!! That's what I don't like aobut annotations. That they have a lot of hidden (magic in marketing language) things.
After your answer I searched and found "Then we need to annotate a @Configuration with either @EnableDiscoveryClient or @EnableEurekaClient - note that this annotation is optional if we have the spring-cloud-starter-netflix-eureka-client dependency on the classpath."