Daniela Todorova
Daniela Todorova

Reputation: 314

Spring boot reactive WebClient calling legacy endpoint

In a Spring Boot (2.2.2.RELEASE) application, I have reactive endpoints (returning Mono or Flux), each of them is using reactive WebClient for calling another service. This "other" service is legacy (non-reactive) one.

Here is my question:

Upvotes: 4

Views: 1445

Answers (2)

Alexander Pankin
Alexander Pankin

Reputation: 3955

If we're talking about HTTP endpoints, we can call them with blocking or non-blocking (asynchronous) clients, but not fully reactive.

If your "new" application is reactive, you have to use non-blocking client (WebClient in your case), otherwise you will block NIO-threads and loose all the advantages of the reactive approach. The fact that the “other” application is blocking doesn't matter, you can still get a less resource-intensive "new" application.

Upvotes: 2

Rajesh
Rajesh

Reputation: 732

They are 1. Not fully. 2. Your request is not full reactive until you change legacy APIs

Explanation: End-to-End Reactive pattern only help into to the performance side Currently you’re using reactive client this helps to connect to server in two way communication. First set of APIs are reactive so web server layer is now reactive but data layer (Legacy APIs ) not reactive

Upvotes: 1

Related Questions