This commit introduces automatic configuration of the messageConverter
property for both the JmsTemplate
and DefaultJmsListenerContainerFactory
.
When a MessageConverter
is configured it will be used to configure both classes.
Fixes: gh-4282
Comment From: mdeinum
@snicoll any change this could go into the 1.3 release? Or would it be for the next maintenance release 1.3.1?
Comment From: snicoll
DestinationResolver
is a good candidate because it definitely linked to your "whole" broker. Same thing for transaction management.
MessageConverter
is a different beast. It may suit your use case but I wouldn't do this by default for two main reasons:
1. Just because you have exposed a MessageConverter
in your app means that you want the default to be associated with it. How would you not associate it if you don't want to? Create your own factory which seems quite a lot for only that
2. I can perfectly see a scenario where multiple MessageConverter
beans are defined. That will blow up if we merge this.
WDYT?
Comment From: mdeinum
If you have multiple MessageConverter
beans you are probably also not using the auto configuration setup as a MessageConverter
on its own isn't doing much. But I can see this for the DefaultJmsListenerContainerFactory
for the JmsTemplate
however this would be a nice addition I guess.
Comment From: snicoll
I want to roll this in once we have a fix for #2784
Comment From: snicoll
@mdeinum in 1.3.3 we will have a new service to easily configure a listener container factory, check JmsListenerContainerFactoryConfigurer
- Until we merge this, I think it 's a good alternative in 1.3. Let me know if that works for you please!
Comment From: snicoll
Thanks for the PR but the code has changed quite significantly since you opened this PR and I've decided to fix it in a slightly different way (see d13b9a9)