Is there any issues with using WebClient for fetching responses from multiple REST APIs which are not reactive based.
Yes, you definitely can, and in fact, the use of WebClient is encouraged by Spring officially. Also, the RestTemplate which is generally the preferred way of communication for REST-based services has already been deprecated.
Also, there are no issues when using WebClient in a non-reactive context
https://docs.spring.io/spring-framework/docs/current/spring-framework-reference/web.html#webmvc-client
However, you'll explicitly have to call subscribe
or block
when using WebClient in a non-reactive context.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With