[INT-4571] MessagingMethodInvokerHelper should allow for injection of MessageHandlerMethodFactory Created: 07/Jan/19 Updated: 11/Jan/19 Resolved: 10/Jan/19
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
|Pull Request URL:||https://github.com/spring-projects/spring-integration/pull/2688|
Currently MessagingMethodInvokerHelper creates a new instance of messageHandlerMethodFactory. However in some environments (e.g., Spring Cloud Stream) that provide additional message handlers, there may already be an instance of messageHandlerMethodFactory as a bean. It would be nice if such instance could be shared, specifically to ensure consistency around the list of argument resolvers. In that case MessagingMethodInvokerHelper can do a look up in BF and see if messageHandlerMethodFactory exist and use it or create new one if it does not.
Also, to avoid conflicts may be have such instance under well known bean name. For example, integrationMessageHandlerMethodFactory.
|Comment by Artem Bilan [ 07/Jan/19 ]|
I wonder what is wrong with an existing HandlerMethodArgumentResolversHolder under the IntegrationContextUtils.ARGUMENT_RESOLVERS_BEAN_NAME bean name.
So, looks like we are covered. What am I missing, please?
Also JIRA has slightly different comment syntax to express code snippets.
Thanks for understanding
|Comment by olegz [ 07/Jan/19 ]|
The real issue is that DefaultMessageHandlerMethodFactory has argumentResolvers and customArgumentResolvers which is a separate issue that I intend to raise with Spring team.
The bottom line is that I as a user should be able to control the resolvers (what they are, the order etc.) and HandlerMethodArgumentResolversHolder is not enough for me to accomplish that especially given the logic in DefaultMessageHandlerMethodFactory.afterPropertiesSet() which places custom resolvers in specific order in relation to regular resolvers.
|Comment by olegz [ 09/Jan/19 ]|