Skip to main content
Dat 3. semester
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Jokefetcher

How to fetch jokes concurrently

The exercise Threaded Jokes kicks off an exercise to fetch jokes from multiple APIs concurrently.

The hardest part is not the fetching of jokes, but rather the creation of DTOs for each API and then a special DTO that contains and gathers all the data. And lastly, you need to do it with threads. You will need to work with the ExecutorService and Future classes.

To get you started, here is a repo with a working solution to the exercise. You can use it as a reference or as a starting point for your own solution:

JokeFetcher 2026 REPO

In the README.md file in the repo, you will find some documentation and two extra tasks for you to do. The first extra task is to add a new API to the solution and the second extra task is to add a new feature to the solution.

Now clone the repo, run the solution and read the code carefully. Then try to add a new Joke API and a new feature to the solution. You can also try to implement your own solution from scratch, if you want to.

Good luck and have fun!

Sequence diagram

This diagram shows how the JokeFetcher works. It fetches jokes from multiple APIs concurrently and collects the results in a JokeDTO.

Sequence Diagram