Javarevisited
Published in

Javarevisited

How to connect to a RestAPI microservice with Spring Boot WebClient

In my previous article we connected to a remote REST API using Finagle and created a CompletableFuture chain to get accounts with balance and transactions. We are using the same use-case now with WebClient to see the differences between the two options.

We can create a WebClient bean with a configurable timeout with the Java Config class below.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Mihaita Tinta

Mihaita Tinta

A new kind of plumber working with Java, Spring, Kubernetes. Follow me to receive practical coding examples.