Skip to content

Support type conversion for datatype channels [INT-912] #4918

Closed
@spring-operator

Description

@spring-operator

Mark Fisher opened INT-912 and commented

When "datatype" is provided and the Message payload does not already match, we should delegate to the ApplicationContext's ConversionService to convert if possible (then still throw an Exception if conversion is not possible either). This will enable hooking in to user-provided converters as well.

Currently, the "datatype" attribute adds a PayloadTypeSelector within a ChannelInterceptor and that simply throws an Exception when the payload type does not match. We need to refactor the "datatype" support so that it becomes more tightly integrated within the channel itself (possibly in AbstractMessageChannel) so that it can actually copy the Message with a newly converted Message type.

Another question is whether we need to support the "datatype" without ConversionService... i.e. behave exactly like today and throw an Exception immediately if the type does not match. That could of course be handled by another boolean property, but it might not be necessary. The "conversionService" could also be configured to be very conservative (which would also impact other places that are using it however).


Affects: 2.0 M1

Issue Links:

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions