
Master practical asynchronous Java with CompletableFuture and Spring Boot, building scalable apps that handle billions of requests, including a stock trading bot, an async Rest API, and non-blocking data access.
Clarify the difference between asynchronous and synchronous communication using Alice and Bob email and http client/server examples; show how asynchronous programming frees threads for other work, boosting cpu utilization.
Understand that asynchronous workloads optimize for high responsiveness using non-blocking threads and thread pools, while parallel workloads maximize throughput by splitting data across cores.
Explore the tradeoffs of asynchronous programming, including improved cpu throughput, scalability, and isolation, alongside increased complexity, debugging challenges, and workload profiling.
Master the CompletableFuture API to fix future limitations, manually complete futures, propagate exceptions with complete exceptionally, and orchestrate asynchronous workflows using completion stages.
The lecture explains the future interface, its blocking get, timeout handling, and limitations like no chaining or first-finished aggregation, using a thread pool; it introduces CompletableFuture as a solution.
Learn to model asynchronous workflows with CompletableFuture by using runAsync and supplyAsync, choose executors, and chain tasks with thenRunAsync, completeAsync, and related methods.
Explore how to handle exceptions in CompletableFuture chains by using exceptionally, handle, and whenComplete, recover the result, and understand how placement and executors affect the final outcome.
Learn to combine multiple asynchronous features with then compose async and then combine async, using completion stage to flatten results and coordinate string, integer, and double outputs.
Build an asynchronous stock trading bot and learn stock market basics—shares, symbols, brokers, and orders—and how completable futures enable automated buy and sell decisions.
Explore building an asynchronous stock trading bot using a broker API and the SDK, submitting and viewing orders while simulating price updates for Tesla, Amazon, and Coca Cola.
Build an asynchronous stock trading bot against a broker API, buying at minimum prices and selling on 20% gains or 10% dips, using non-blocking futures and scheduled tasks.
Explore how Spring Boot uses Tomcat threads to handle requests and why blocking hurts performance; enable asynchronous workflows by dispatching work to threads with executor threads configured via application properties.
Learn how Spring Boot enables asynchronous execution with the @Async annotation and a default thread pool, decoupling controller threads from long-running tasks using CompletableFuture.
Replace the default Spring Boot simple async task executor with a custom thread pool and assign dedicated executors to specific async methods for isolated workloads.
Build an end-to-end asynchronous Spring Boot app that fetches images from the Pixabay API by word, using an async controller and service with Unrest and CompletableFuture.
Build an end-to-end asynchronous spring boot app that uses get requests with query parameters, deserializes json with jackson, maps to image list, and returns an html string via non-blocking futures.
Make the request flow end-to-end asynchronous by returning a CompletableFuture from a Spring Boot rest controller and delegating to a dedicated picture service for external api calls, improving throughput.
Learn how to query data from a MySQL database asynchronously in Java using the MySQL dev API, including a docker-based setup, non-blocking execute async, and handling results.
Connect to Redis asynchronously in a Java project using Lettuce, deploy a Redis Docker container, map ports, and run async commands with Redis futures and completion stages.
Learn to use the MongoDB async driver in Java to query a collection asynchronously via callbacks, and bridge results to a CompletableFuture for seamless async programming.
Explore why monitoring a thread pool is essential in asynchronous Spring Boot apps, analyzing core and max pool sizes, queue capacity, and rejected tasks, with live metrics for tuning.
Set up a docker-based monitoring stack with Prometheus and Grafana to collect and visualize Spring Boot metrics, using a pre-built docker-compose, host-endpoint scraping every 15 seconds, and dashboards in Grafana.
Configure Spring Boot Actuator and Micrometer to expose Prometheus metrics for a thread pool, and monitor queued tasks, core pool size, max threads, and active threads in Grafana.
Intro
This course is the best online resource you need to become proficient in building asynchronous code in Java, by learning to work with Completable Futures API, by building non-blocking workflows in REST APIs with Spring-Boot, by fetching data from databases asynchronously, and also by learning to monitor Thread-Pools to see if they're used properly in your applications.
The goal of this course is to make you deeply understand the main asynchronous concepts (that can be re-used in many other languages), applied and exemplified in Java, the language used by many large companies and more than 9 million developers around the world.
About myself
I wrote my first line of code 10 years ago when I was in highschool. I quickly got addicted by how easy you could build useful programs using C# and Windows Forms.
I followed the Computer Science University track where I managed to set the ground knowledge for anything related to Software Engineering (Algorithms, Data Structures, Operating Systems, Multithreading, Distributed Computing, Networking, and many other topics), and I finalized this amazing 6-year learning path by getting a Master's Degree in Parallel and Distributed Systems where I built from the ground a custom Kubernetes Gang Scheduler optimised for running Spark Jobs.
Currently, I'm a Senior Software Engineer focused on large-scale JVM-based development. I build code used by millions of people around the world.
Why I built this course?
Having experience with asynchronous code is a must for any Software Engineer who wants to step into a Senior role. I saw many people struggling to understand things like:
Why is my application stuck? How can I debug it?
How can I run this method on a different thread?
How do I know if my async application is using the resources efficiently?
It was really hard for me too to understand some of those things, even if I had enough university background in this area.
But fortunately, after many years of working with threads, callbacks, thread-pools, many trial and errors, many profiling sessions and books & articles read, I managed to deeply understand those critical concepts and use them properly in my daily job.
For those reasons, I thought that building a course where I expose my understanding on asynchronous workflows, would definitely help other people to save time and avoid going into the same pitfalls that I went through.
What is the content course?
This course is split into 5 chapters and each one will learn you a new angle of applying asynchronous code in your applications:
Chapter 1 - General Concepts around Asynchronous Programming
In this chapter we're going to learn the basics of asynchronous programming - what we refer to by "async" (with some really cool examples), we're going to clarify a common confusion - which is the main difference between parallel and asynchronous, and also we're going to learn about the tradeoffs of async programs compared to the traditional programming, because there are also some aspects we need to be aware of.
Chapter 2 - Asynchronous Programming in Java with Completable Future
This is the first chapter in where we're going to go hands-on by learning about the Completable Future API - how it differs from a classical Future, how can we deal with exceptions, and also how we combine multiple futures together to execute more complex scenarios.
Finally, we're going to build an asynchronous trading bot, where we apply all the things we learned, in a very interesting project.
Chapter 3 - Building an Asynchronous REST API with Spring-Boot
In this chapter, we're going to shift gears and explore the Spring-Boot framework, with an emphasis on building Asynchronous code (with @Async annotation), and we're going to also configure the asynchronous mechanism by changing the underlying thread-pool where @Async annotated methods execute.
In the end, we're going to build a very interesting project, which is a fully async REST API that downloads images from an external system, based on a keyword provided by the user.
Chapter 4 - Fetching data from a database asynchronously
Data access is a very important aspect, mostly in asynchronous applications, where flows need to be async end-to-end. It doesn't make sense to handle a request asynchronously, but fetch data in a blocking fashion.
For that reason, in this chapter we're going to explore non-blocking database clients for MySQL and Redis, that should be used in any async application, to properly build a data-access workflow.
In the end, I left an exercise for you to explore the async data-access process for Mongo DB, which will be really interesting to follow.
Chapter 5 - Monitoring ThreadPools in Asynchronous applications
In this last chapter I'm going to show you how to properly monitor a ThreadPool using Prometheus and Grafana (a well known Open Source monitoring stack).
We do that by first understanding why monitoring thread-pools is important, by building and configuring the monitoring stack with Docker, and finally by instrumenting our Spring-Boot application to expose metrics in a Prometheus format.
What are the requirements for this course?
Basic Java Knowledge (including Object Orientated Programming)
Basic Java Multithreading concepts are a plus, they'll help you to grasp the concepts of this course faster
An IDE of your choice, ideally IntelliJ Idea Community Edition, but you can use any IDE where you can run plain Java code
Willingness to learn and an open-mind
Thank you for taking the time to look through this description and I'm looking forward to see you in the first lecture!