admin-ch/CovidCertificate-Management-Service

Code uses WebClient but blocks

marschall opened this issue · 3 comments

The code uses the reactive WebClient but ends up calling #block() which, as the name suggests, blocks and therefore defeats the whole purpose of using WebClient in the first place. Examples:

The code should instead do one of the following:

  • Avoid calling #block() and instead call #subscribe()
  • Switch from the reactive WebClient to the blocking RestTemplate

Considering all the rest of the code is blocking (JpaRepository, …) WebClient seems like the better match.

@Armin-Isenring-Bit what is the reason for closing?

@marschall we have been investigating both suggested changes due to unwanted behaviour in the service grid (which this service is a major part of). Both had disadvantages which of this time the team does not want to buy in. We are still doing research in this matter.
Your comment is a good point, closing it has nothing to do with its quality or the substance of your concern.