Using WebClient in a New Exhibition Project
Key point
This introduces a case where Oliveyoung's Exhibition team adopted WebClient instead of the existing RestTemplate while transitioning to an MSA architecture.
Details
Oliveyoung's Exhibition team is in the process of transitioning from an existing monolithic architecture to MSA (Microservices Architecture). In particular, during the process of building a new API to separate the frontend/backend dependencies of the 'Premium Hall,' they adopted WebClient.
While the existing RestTemplate is a synchronous method based on Blocking I/O, WebClient supports a Non-Blocking method, enabling both synchronous and asynchronous calls. They confirmed that as the number of concurrent users increases, WebClient shows significantly better performance than RestTemplate.
When implementing this in practice, the following configurations are considered:
- MaxInMemorySize: Adjusting the codec's buffer size to prevent memory issues
- TimeOut: Setting connection and response time limits
- mutate(): A method of maintaining immutability by cloning an existing WebClient instance to change its configuration
WebClient provides a Functional API based on Reactor, using Mono (0-1 result) and Flux (0-N results).
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.