WebClient is meant to be used in a reactive environment, where nothing is tied to a particular thread (this doesn't mean you cannot use in a traditional Servlet application). Spring Boot helps you with that by creating and configuring for you a WebClient.Builder bean that you can inject anywhere in your app.īecause WebClient is immutable it is thread-safe. This means you should try to derive all WebClient instances from the same WebClient.create() call. With that in mind, you should try to reuse the same ClientHttpConnector across your application, because this will share the connection pool - this is arguably the most important thing for performance. Its HTTP resources (connections, caches, etc) are managed by the underlying library, referenced by the ClientHttpConnector that you can configure on the WebClient.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |