Asynchronous Non-Blocking Microservices Tutorial in Springboot with Java Code Example for Beginners

preview_player
Показать описание
In this video we will learn about Non-Blocking Asynchronous Microservices in Springboot framework using Async annotation with Java coding example.

A non-blocking API for the resources allows calling the resources without waiting for the blocked call such as database access and network calls. If the resources are not available at the time of calling, then it moves to other work rather than waiting for the blocked resources. The system is notified when the blocked resources are available.

** Difference between Blocking & Non-Blocking Microservices **
The synchronous (blocking APIs) block the execution of the thread where they are called until a result is received from the server. The asynchronous (non-blocking) APIs do block, the program can continue its execution. The asynchronous (non-blocking) APIs uses methods with a call-back argument.

** What is Multithreading? **
Multithreading refers to a process of executing two or more threads simultaneously for maximum utilization of the CPU. A thread in Java is a lightweight process requiring fewer resources to create and share the process resources. Multithreading is the ability of a program or an operating system to enable more than one user at a time without requiring multiple copies of the program running on the computer. Multithreading can also handle multiple requests from the same user. Multithreading allows the execution of multiple parts of a program at the same time. These parts are known as threads and are lightweight processes available within the process. So multithreading leads to maximum utilization of the CPU by multitasking.

** What is multithreading in Java? **
In Java, Multithreaded applications execute two or more threads run concurrently. Hence, it is also known as Concurrency in Java. Each thread runs parallel to each other.

** What are worker threads in java? **
Worker thread in Java is a high-priority thread that runs in the foreground. Worker thread is a continuous parallel thread that runs and accepts messages until the time it is explicitly closed or terminated. Messages to a worker thread can be sent from the parent thread or its child worker threads.

** What are the benefits of multithreading? **
1. multithreading Improved throughput.
2. Simultaneous and fully symmetric use of multiple processors for computation and I/O.
3. Superior application responsiveness.
4. multithreading Improved server responsiveness.
5. Program structure simplification.
6. Better communication.

** Multithreading in Springboot **
Multithreading in spring boot is achieved using Async annotation and using Task Executor Service class. Multithreading in spring boot is similar to multitasking, except that it allows numerous threads to run concurrently rather than processes. A thread in Java is a sequence of programmed instructions that are managed by the operating system's scheduler. Threads can be utilized in the background to conduct complex activities without interfering with the main program. It is worth mentioning that a thread shares common memory with other threads across the application, but a process is separate and does not share memory.

** Usage and Advantage of Non-Blocking Microservices **
1. Non-blocking asynchronous microservices can handle very high number requests at the same time.
2. This approach can be used for sudden surge in the incoming request.

** Chapter Timestamps **
0:00 Introduction to Non-Blocking Asynchronous Microservices
1:21 Agenda of this video
3:14 Understanding Parallel Processing
7:02 Understanding Asynchronous processing
9:58 Understanding blocking microservices and challenges
14:58 Explaining Non-Blocking Asynchronous Microservices Solution
17:42 Difference between Blocking and Non-blocking Microservices
19:54 Spring boot Async Annotation explained
20:50 Java code implementation of Non-Blocking Asynchronous Microservices
27:08 Performance Testing of Blocking & Non-Blocking Asynchronous Microservices.
31:10 Usage of Non-Blocking Asynchronous Microservices
32:23 Advantages of Non-Blocking Asynchronous API
33:58 Summary of Non-Blocking Asynchronous API

#asynchrounousapi #nonblockingapi #microservice

** GIT Project Link **

** CHECK OUT OUR OTHER VIDEOS **

** CHECK OUR PLAYLISTS **

** ABOUT OUR CHANNEL **
CodeOneDigest is a youtube channel that produces videos on programming languages, cloud and container technologies, Software design principles, Java frameworks in English languages.
Рекомендации по теме
Комментарии
Автор

Hello friends, new #video on #asynchronousapi #nonblocking #microservice with #java #coding #examples is published on #codeonedigest #youtube channel.
@java #java #awscloud @awscloud @AWSCloudIndia #Cloud #CloudComputing @YouTube #youtube #azure #msazure #asynchronousapi #asynchronousapiinspringboot #asynchronousapicallsjava #asynchronousapicall #asynchronousapijava #asynchronousapiinnodejs #asynchronousapicallinjava8 #nonblockingapi #nonblockingapiinspringboot #nonblockingapicallsjava #nonblockingapicall #nonblockingapijava #nonblockingapiinnodejs #nonblockingapicallinjava8 #microservices #api #asynchronousmicroservice #asynchronousmicroservicecall #asynchronousmicroservicejava

codeonedigest
Автор

Excellent sir, really helpful while creating the rest Apis in the microservice architecture, and deserves thousands of likes

kiranmayi-pd
Автор

Your explanation is very clear. Thank you.

santhosh
Автор

You really deserver thousands of likes. Thanks you bro

engalibadouin
Автор

thanks sir, this is helpful to understand this. Please continue making videos like this. I request you to make videos on kafka.

Satishkumar-rxoy
Автор

Awesome sir can you please share code with us github link is not present in description it would be very appreciated thanks.

sujitkumar
Автор

Awesome tutorial but git hub link is not available can you provide us it would be very helpful.Thanks

sujitkumar
Автор

HI Sir, Its nice one. Please share the code shown in video for reference. And one question -> Blocking call case same thread th1 take up the request and handle it by sending the response. IN the case of non blocking, Thread th1 takes up new request by handing over the first request's IO call to worker thread.Meanwhile what happen to first user's UI without any response? How the first request's response would be given to user after IO operation is done?

VenuGopal-prix
Автор

You are doing customer getting/saving operation in synchronous manner then whats the benefit of AsyncService here? I am confused.

zakariahossain
Автор

Hi, I just discovered your channel. Do you have a linkedin account so I can repost your content? Greetings from the Philippines

lunatichigh
Автор

where is the github url for source code ?
Please share the github url for source code

ankursingh
Автор

Please share the github url for nonblocking microservice

ankursingh