diff --git a/spring-integration-webflux/src/main/java/org/springframework/integration/webflux/config/WebFluxOutboundChannelAdapterParser.java b/spring-integration-webflux/src/main/java/org/springframework/integration/webflux/config/WebFluxOutboundChannelAdapterParser.java
index d9afb27ba44..e4c8c8328ff 100644
--- a/spring-integration-webflux/src/main/java/org/springframework/integration/webflux/config/WebFluxOutboundChannelAdapterParser.java
+++ b/spring-integration-webflux/src/main/java/org/springframework/integration/webflux/config/WebFluxOutboundChannelAdapterParser.java
@@ -51,6 +51,11 @@ static BeanDefinitionBuilder buildWebFluxRequestExecutingMessageHandler(Element
String webClientRef = element.getAttribute("web-client");
if (StringUtils.hasText(webClientRef)) {
+ if (element.hasAttribute("encoding-mode")) {
+ parserContext.getReaderContext()
+ .error("The 'web-client' and 'encoding-mode' attributes are mutually exclusive.", element);
+ }
+
builder.getBeanDefinition()
.getConstructorArgumentValues()
.addIndexedArgumentValue(1, new RuntimeBeanReference(webClientRef));
@@ -67,8 +72,8 @@ static BeanDefinitionBuilder buildWebFluxRequestExecutingMessageHandler(Element
if (hasType && hasTypeExpression) {
parserContext.getReaderContext()
- .error("The 'publisher-element-type' and 'publisher-element-type-expression' " +
- "are mutually exclusive. You can only have one or the other", element);
+ .error("The 'publisher-element-type' and 'publisher-element-type-expression' attributes " +
+ "are mutually exclusive.", element);
}
if (hasType) {
diff --git a/spring-integration-webflux/src/test/java/org/springframework/integration/webflux/config/WebFluxOutboundGatewayParser-encoding-mode-fail.xml b/spring-integration-webflux/src/test/java/org/springframework/integration/webflux/config/WebFluxOutboundGatewayParser-encoding-mode-fail.xml
new file mode 100644
index 00000000000..c3e63746796
--- /dev/null
+++ b/spring-integration-webflux/src/test/java/org/springframework/integration/webflux/config/WebFluxOutboundGatewayParser-encoding-mode-fail.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
diff --git a/spring-integration-webflux/src/test/java/org/springframework/integration/webflux/config/WebFluxOutboundGatewayParserTests-context.xml b/spring-integration-webflux/src/test/java/org/springframework/integration/webflux/config/WebFluxOutboundGatewayParserTests-context.xml
index b78b84d2104..b217a78bd2a 100644
--- a/spring-integration-webflux/src/test/java/org/springframework/integration/webflux/config/WebFluxOutboundGatewayParserTests-context.xml
+++ b/spring-integration-webflux/src/test/java/org/springframework/integration/webflux/config/WebFluxOutboundGatewayParserTests-context.xml
@@ -25,6 +25,7 @@
+ new ClassPathXmlApplicationContext("WebFluxOutboundGatewayParser-encoding-mode-fail.xml",
+ getClass()))
+ .withMessageContaining("The 'web-client' and 'encoding-mode' attributes are mutually exclusive");
}
}