Skip to content

Better support for generics and lambdas in JmsTemplate [SPR-10412] #15045

@spring-projects-issues

Description

@spring-projects-issues

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:

0 votes, 6 watchers

Metadata

Metadata

Assignees

Labels

in: messagingIssues in messaging modules (jms, messaging)status: declinedA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions