Currently HttpRequestExecutingMessageHandler creates new instance of RestTemplate if no one specified explicitly.
It may be more convenient to use preconfigured RestTemplate bean in current ApplicationContext. If there no RestTemplate beans then default to new instance.
The problem that make me reluctant to implement your request is that Spring Integration components don't do any auto-injection magic for user-defined beans. Plus this HttpRequestExecutingMessageHandler is a bit complex component to break it for potential auto-injection. Also pay attention how its restTemplate property is final. That's another argument do not implement auto-injection - for performance reason at runtime.
Vyacheslav opened INT-4460 and commented
Currently
HttpRequestExecutingMessageHandler
creates new instance ofRestTemplate
if no one specified explicitly.It may be more convenient to use preconfigured
RestTemplate
bean in currentApplicationContext
. If there no RestTemplate beans then default to new instance.Example:
Affects: 5.0.4
The text was updated successfully, but these errors were encountered: