Service Discovery and Microservices Tutorial
Ғылым және технология
Service Discovery. What is Service Discovery? In this series I will teach you how to build microservices with spring boot, spring cloud, docker and Kubernetes. In this video you will learn how to use service discovery
Microservices - also known as the microservice architecture - is an architectural style that structures an application as a collection of services that are
- Highly maintainable and testable
- Loosely coupled
- Independently deployable
- Organized around business capabilities
- Owned by a small team
The microservice architecture enables the rapid, frequent and reliable delivery of large, complex applications. It also enables an organisation to evolve its technology stack.
#servicediscovery #microservices #amigoscode
COURSE AVAILABLE: amigoscode.com/p/microservices
Links
Repo - github.com/amigoscode/microse...
Spring.io - spring.io/
Getting Started with Maven - maven.apache.org/guides/getti...
Docker - amigoscode.com/p/docker-devops
More Courses - amigoscode.com/courses
Don't Forget to
===========================================
💯 Subscribe to Amigoscode - bit.ly/2HpF5V8
💯 Courses Available for free here - amigoscode.com/courses
💯 Join Private Facebook Group and Discord - amigoscode.com/p/join-community
⭐ Table Of Contents ⭐
===========================================
00:00 - Intro
01:15 - What is Service Discovery
05:31 - Spring Cloud Dependency
09:15 - Setting Eureka Server
15:00 - Eureka Dashboard
17:01 - Eureka Clients
24:48 - Load Balance Requests
31:47 - Outro
🙊 Here are the goods for all my videos video 🙊
► Recommended Books
===========================================
- Clean Code - amzn.to/2UGDPlX
- HTTP: The Definitive Guide - amzn.to/2JDVi8s
- Clean Architecture - amzn.to/2xOBNXW
► Computer and Monitor
===========================================
- New Apple MacBook Pro - amzn.to/3464Mmn
- Dell 27 INCH Ultrasharp U2719D Monitor - amzn.to/2xM3nW1
- Double Arm Stand Desk Mount - amzn.to/3aYKKfs
- USB C Hub Multiport Adapter - amzn.to/2Jz7NlL
► Camera Gear
=============================================
- Sony ILCE7M3B Full Frame Mirrorless Camera - amzn.to/346QIJn
- Sigma 16 mm F1.4 DC DN - amzn.to/2wbic3Q
- Sigma 33B965 30 mm F1.4 DC DC - amzn.to/39G37Fd
► IDE & Tools I use for coding 💻 🎒
===========================================
- ITerm
- VsCode
- GoLand
- IntelliJ Ultimate
- Sublime
P.S
===========================================
💯 Don't forget to subscribe | bit.ly/2HpF5V8
💯 Join Private Facebook Group and Discord - amigoscode.com/p/join-community
💯 Follow me on Instagram | bit.ly/2TSkA9w
❤️ Thanks for watching
Пікірлер: 123
Thank you so much for creating such amazing courses. I have been following up all your courses one by one and learning a lot of new things from each and every video.
thank you. I didn't understand it, so I looked for it for a while, but after watching the video, I understood it right away. Your lectures are very nice. you are my benefactor
Thanks for such a useful and clear lesson! I didn't imagine that spring cloud allows us to organise microservises communication so easily
Wow... I knew nothing about service discovery but after your course... all i can say is WOW!! Thanks bro
Another great addition to the Microservices series! Keep up, Nelson!
You are a really good teacher. I appreciate your help. I hope you will continue these videos and light up developers like me.
Great video Nelson. I'm following all your videos and learning so many thing. Congrats for your amazing work. Muito obrigado amigo!
I also really appreciate for your help created this course. I hope your gods will bring you with luck and healthy. Thank you so much.
Thanks for this tutorial. Literally saving my life with this one!
Great video, as always :) Would love to see video about securing all those microservices!
Thank you Nelson so much for the course. Keep it up. Your content is so good that everything is explained very vell. 😊
Let me thank you for this awesome course boss... Stay blessed man
Thank you for this video Please keep going with this series :)
Amazing course, great! Thank you for this content!
Thank you very much for all your amazing videos.
Salem, baraka allah fik, Great content, I have learned a lot from this serie Please keep going and thanks again.
Salam alikom from Morocco thank you very much. Allah yjazik bekhayr
awesome , the best way to start the week
Thanks a lot! You're a Great Lecturer!
Useful content always , thanks alot amigos we grow alot from your content
@whatsappadmin2206
2 жыл бұрын
👆 For consultation and assistance
am always following your videos hey they are really amazing.
Amazing course, great!!Thank you.
What amazing course, Thanks~
When you got error when using service name, there was only single instance. In order to clarify, you had created one more instance. Why the exception when only one instance of service is there.
Very well explained, thanks!
Awesome course, I already bought it and I highly recommend it! I would appreciate a section on how to secure (authentication/authorization) all these microservices, how to prevent unauthorized access in some of microservices and how to implement a Bearer token in microservices environment.
@CaptainStache
2 жыл бұрын
Spring Security does this job that you want my friend. You can create a JWT token with spring security and pass it as a header into the request. Some services don't need bearer token (like user registration.) The most common primary service that uses bearer token is login because the token is gonna be created after the user registration!
@krisorsmso5094
2 жыл бұрын
Amigos has a great tutorial on spring security as well.
Excellent work, thank you very much
Would love to rock in an AMIGOS CODE t-shirt. Thanks for the awesome tutorial.
@whatsappadmin2206
2 жыл бұрын
👆 For consultation and assistance
tks for new amazing video and your share
Very clear! Thank you, keep going)
That was ace, thank you.
Thank you for your help 😊
Thanks for tutorial!
perfect explanations!
Amazing content.. thank you for this video
thank you very much you are amazing man
Thanks to you I switched from Nest js after 2 years of using it, to spring boot, and no regrets I'm enjoying Spring boot. Great content, great videos.
@whatsappadmin2206
2 жыл бұрын
👆 For consultation and assistance
thanx Nelson for the content
great course thanks :D
So So So good tutorial, man you are awesome
A truly amigo. Thank you so much, Mama Samba
@whatsappadmin2206
2 жыл бұрын
👆 For consultation and assistance on investment
Be Blessed Man!
Thank you!
👏👏👏well done Amigo
thank you very much
In a cloud environment (Azure), would you recommend deploying our services on top of Azure Kubernetes Service or Azure Spring Cloud?? Given that they both provide similar functions like service discovery, centralized config?
Thanks Amigo!
awesome !
man, ur so pro.
Thanks!!
شكرا يا حب ♥
God this is GEM!!!
Great content and teacher! One question: on Postgres pgAdmin4 i see that sequences are all made with INCREMENT 50 instead of default INCREMENT 1. Is that a way to set this parameter on app?
Thanks a lot brother
@whatsappadmin2206
2 жыл бұрын
👆 For consultation and assistance
Can you explain the comparison of eureka vs zookeeper vs consul with simple examples?
Syukran, Nelson
Amazing Content ...
@whatsappadmin2206
2 жыл бұрын
👆 For consultation and assistance on investment
Thanks bro
THANKS VERY MACH
useful content
As-salamu alaykum from Greece!
@whatsappadmin2206
2 жыл бұрын
👆 For consultation and assistance
The BEST!!!
@whatsappadmin2206
2 жыл бұрын
👆 ❤️ For consultation and assistance
Please create one video on spring boot with Jooq and postgresql. Thanks!
Thanks brother
@whatsappadmin2206
2 жыл бұрын
👆 For mentorship and assistance on investment
Assalamu alaikum bro. Thank you for an awesome content.😊
@whatsappadmin2206
2 жыл бұрын
👆 For consultation and assistance
May Allah Taala bless you sir
@whatsappadmin2206
2 жыл бұрын
👆 For consultation and assistance on investment
Looked up how Spotify went down last month , it had to do something with service discovery, then this video came up on my feed. What a Coincidence
Hey, I've a question. For first time fraud had just one instance, why we got server error?
Asalam alaykoum Amigos, so much great content, thank you ! Is it possible to make a video about making software engineering youtube video tutorials, your pipeline, your setups... ? It would help newcomers to also begin making high quality videos as your's. Baraka allah fik
@whatsappadmin2206
2 жыл бұрын
👆 For consultation and assistance
thanks you, please explain to me, why status in application session on eureka dashbord of me is host.docker.internal instead of ip address like you?
Thanks for the amazing content! Just a question: what’s the purpose of service discovery? What is the common use cases in which we could consider to use it? Thanks again!
@CaptainStache
2 жыл бұрын
Service Discovery is actually the mechanism that allows you to register every single (micro)service in it. It is based on the election leader and service registry algorithm. The purpose of service discovery is to check the available instances that have been created and registered to the service registry. We care about that because microservices is a distributed system. Every single instance of microservice is actually a worker into the distributed system and every worker has a purpose to fulfill. If an instance has bad health and it cannot handle the requests, the service discovery here kicks in and it is responsible to create a copy/duplicate of the current microservice (worker) before it is going to terminate because of its bad health. When the new instance of microservice is going to be available then it going to be registered into the service registry and it goes on.
@frapder
2 жыл бұрын
@@CaptainStache Thanks for the detailed explanation!
@krisorsmso5094
2 жыл бұрын
@@frapder This mechanism also allows horizontal scaling - when you get more traffic going another instance could be booted up instantly without the interuption of the actual application. There's basically some application state observers in place - which define how many instances should be up and running minimum. In Kubernetes it's called the watch loop. When you're dealing with monolithic application you would need to provide a single more powerful machine (vertical). This solution can only work for certain amount of workload. And also has a single point of failure.
Does it works with WebClient given that RestTemplate is depreciated?
Can anyone help me ? with some doubts I have, but first great video then this project is based on multi module tier and docker compose how do you handle partial update(just one microservice but without taking down the other services) via CI/CD (in my case I use github actions) the idea is mmm like one repository multiple services but when need it just update the one updated....
Hi , thanks for the awesome explanation, the question is are there another options instead rest template to work and using load balancing to communicate?
@whatsappadmin2206
2 жыл бұрын
👆 For consultation and assistance
@CaptainStache
2 жыл бұрын
load balancing is the mechanism that gives us the ability to manage the network traffic/requests and spread them to every available microservices that is registered into the service discovery. API gateway (Zuul) can do this work or Ribbon Load Balancer in this case. Load Balancer has many algorithms that distributes the traffic in correct sequence to each microservice but the most common is round Robbin. Now for the communication between microservices there are some categories: External communication using clients such a rest Template or Feign Client to CONSUME an external microservice. Internal Communication using Message Brokers (Rabbitmq, redis, Kafka) or with the use of gRPC. P.S I edited my comment
@krisorsmso5094
2 жыл бұрын
asynchronous communication would also work - An application publishes an event within Rabbit MQ. And the other instances are constantly monitoring the event table for published events to be dealt with.. This however might not be sufficent for all the use-cases - for instance GET requests need instant feedback.
I faced a problem: anytime a fraud instance is added/removed from eureka-server the customer instance must be rebooted for loadbalancer to be updated.
Manshallah Manshallah ❣
@whatsappadmin2206
2 жыл бұрын
👆 For consultation and assistance
@atalibcodinglevel7518
2 жыл бұрын
The WhatsApp is not showing
Oki Doki😀
Asalam alaykoum, thank you for your great videos. I am wondering if you can tell us the options that microservices can talk to each other beside Rest template and which one is popular and beter?
@lukmanmudi5742
2 жыл бұрын
Let me share this (in case you don't get a better reply). I know 3 ways you can make service to service communication. 1. Using Rest template (obviously) 2. Using HttpClient along with (HttpRequest and HttpResponse) added in Java 9. 3. Using MicroProfile Rest Client Rest template is popular in Spring framework (IMO) HttpClient API is mostly common in desktop applications (IMO) MicroProfile Rest Client is popular in the Java EE (now Jakarta EE) ecosystem(IMO)
@nesreenmohd665
2 жыл бұрын
@@lukmanmudi5742 Thank you for your reply. So if I have a web based application, which on is the best to study it and practice it?
@CaptainStache
2 жыл бұрын
1. Rest Template (Synchronous) ot Feign Client (Asynchronous) clients are for communication with EXTERNAL microservices in real case scenario. 2. The most common way to communicate with internal microservices is using a message broker (rabbitmq, redis, Kafka) Kafka is the most powerful one. You need pub/sub pattern to achieve that etc 3. Now one more advanced method to communicate with each microservice is gRPC.
Hello Nelson, I wanted to purchase this full course. Any promotion or coupon code?
Can We use feign client? To do IPC and does it have load balancing?
@amigoscode
2 жыл бұрын
In the full course I show how to use feign
Hii , I am a novice in spring boot applications and I love your videos . For this video I understood almost everything except one part as to how did the RestTemplate class got updated when we put @LoadBalanced annotation in the CustomerConfig class as we just made a normal method there that just returns a new RestTemplate Object so what's that got to do with the whole RestTemplate class .. I needed help with this question..!!!??
@TheEntium
2 жыл бұрын
Because the method which we annotate as a @Loadbalanced is also a bean (because of @bean annotation) now spring will handle all the object creation when this method gets called anywhere which returns a new RestTemplate .. and this RestTemplate is injected during our rest call. Once we add @Loadbalanced annotation to the RestTemplate bean load balancing mechanism will apply on it.. So now wherever this bean (RestTemplate) called loadbalancing will automatically happen
@vidhangoyal373
2 жыл бұрын
@@TheEntium thanks for the explanation, I got it now 👍
🤩🤩🤩🤩
@whatsappadmin2206
2 жыл бұрын
👆 For consultation and mentoring
good good good
Walaikum Salam
Hello Amigos, great content. I tried to replicate a service like you did and change the URL to the registered name of the service like you did at time 25:30 going, but haven't been successful, checked the git repo but the implementation wasn't present. Thanks again and please assist with what i pointed out
@konradmaocha6397
2 жыл бұрын
Yoyo, have u tried to add @LoadBalanced annotation above RestTemplate bean creation method? Check this out: github.com/amigoscode/microservices/commit/f380637d80b3ff5990d3465a50da4ab35e0684d7#diff-dc459c235a779d88b39fb0e7b5b9ab694c0b25450fb0ca2be2c0eb748f866a26
En español Amigoscode pero hablas en ingles wooo
sir can you give subtitle in urdu
@whatsappadmin2206
2 жыл бұрын
👆 For consultation and assistance
Hi Amigos. Your skill is so excited but can you sell this course in the udemy ?
You means... DNS...
You have the best content. Please explain two things. 1)I didn't understand why it doesn't send requests without @LoadBalanced (in the case of one service in Eureka). Does @EnableEurekaClient not allow you to do it? 2) Unexpectedly, @LoadBalanced is put on @Bean RestTemplate. How does he know that RestTemplate is able to send requests?