diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/config/ChannelParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/channel/config/ChannelParserTests.java index 2b7ff02f5d..bb734e8476 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/channel/config/ChannelParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/config/ChannelParserTests.java @@ -166,6 +166,15 @@ public class ChannelParserTests { assertTrue(TestUtils.getPropertyValue(channel, "messageConverter") instanceof UselessMessageConverter); } + @Test + public void testDatatypeChannelGlobalConverter() { + ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("channelParserGlobalConverterTests.xml", this + .getClass()); + MessageChannel channel = context.getBean("integerChannel", MessageChannel.class); + context.close(); + assertTrue(TestUtils.getPropertyValue(channel, "messageConverter") instanceof UselessMessageConverter); + } + @Test public void testDatatypeChannelWithAssignableSubTypes() { ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("channelParserTests.xml", this diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/config/channelParserGlobalConverterTests.xml b/spring-integration-core/src/test/java/org/springframework/integration/channel/config/channelParserGlobalConverterTests.xml new file mode 100644 index 0000000000..07f2fb248b --- /dev/null +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/config/channelParserGlobalConverterTests.xml @@ -0,0 +1,16 @@ + + + + + + + + + + diff --git a/src/reference/docbook/channel.xml b/src/reference/docbook/channel.xml index efbfc35da9..3e1b08a828 100644 --- a/src/reference/docbook/channel.xml +++ b/src/reference/docbook/channel.xml @@ -521,6 +521,11 @@ payload to an Integer. payload, or a full Message object. If the latter, the converter must be careful to copy all the headers from the inbound message. + + Alternatively, declare a <bean/> of type MessageConverter + with an id "datatypeChannelMessageConverter" and that converter will be used by + all channels with a datatype. +