You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
The @Rest generated implementation rely on a RestTemplate instance. Currently, each injection of an @Rest annotated interface leads to the creation of a new instance of the class implementing this interface.
Users can customize the RestTemplate instance, but they have to do it on a per implementation instance bases, which isn't great. This also leads to the creation of a lost of RestTemplate instance.
We could either :
Let @Rest implementations be singletons. But there might be cases where one need different configurations and thefore different instances
Allow scope configurations (singleton / prototype / context?). In such a case, we must decide what's the best "default". It's probably singleton, but since @EBean has a default on prototype, maybe we should emphasize coherence
By the way, this isn't totally related, but maybe we should create an interface with setRestTemplate() and getRestTemplate() methods, and let @Rest clients implement it, rather then defining the methods in the interface ?