Connecting To Forbes400

`Forbes400` is an open API that provides the full list of billionaires. We will update our Spring Boot Billionaire's Club application to fetch billionaires from the `forbes400` open API.

Connecting to forbes400 during application startup

We can connect to the Forbes 400 API during startup. The question is where to write our logic because the application should not accept any traffic before DB is completely filled.

As usual spring framework has a built-in solution for the above problem. We can utilize ApplicationRunner/CommandLineRunner interfaces from spring boot.

Contract of above classes is well suited for tasks that should run after application startup but before it starts accepting traffic.

Get hands-on with 1200+ tech skills courses.