Hello everyone, today we are going to learn how to ping multiple HTTP endpoints by run multiple threads concurrently in java. I am using ExecutorService Approach to achieve the goal.
What is the ExecutorService?
The ExecutorService is the interface that sanctions us to execute tasks on threads asynchronously. The ExecutorService avails in maintaining a pool of threads and assigns them tasks. It withal provides the facility to queue up tasks until there is a free thread available if the number of tasks is more than the threads available.