-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
Philippe Marschall opened SPR-10412 and commented
I'm a bit unhappy with the API of JmsTemplate and MessageConverter and wanted to ask whether it would be possible to make some changes for Spring 4.0. Basically because MessageConverter is not generic #receiveAndConvert has to do a cast, and #convertAndSend is not type safe. Making MessageConverter generic itself doesn't fix the problem because there can only be one MessageConverter per JmsTemplate. It would have to be passed as an argument so that type propagation works correctly. As this likely will have to wait for Spring 4 which has Java 8 / lambdas as a topic MessageConverter should probably be split into two interfaces (one for sending, one for receiving).
Maybe the interfaces should be tagged with java.lang.FunctionalInterface but that would have to be done over the whole code base.
Issue Links:
- Support org.springframework.messaging.Message as an alternative to MessageCreator in the JMS support [SPR-11772] #16394 Support org.springframework.messaging.Message as an alternative to MessageCreator in the JMS support
0 votes, 6 watchers