From cf6f2d6fc2c559d20d62da85a828fed57d7783ca Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Mon, 12 May 2025 16:49:13 -0400 Subject: [PATCH] GH-10018: Fix bugs from the previous commit Related to: https://github.com/spring-projects/spring-integration/issues/10018 --- .../integration/gateway/GatewayMessageHandler.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayMessageHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayMessageHandler.java index 6e87f67dc9..d8b936e678 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayMessageHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayMessageHandler.java @@ -24,6 +24,7 @@ import java.util.concurrent.locks.ReentrantLock; import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; +import org.springframework.core.task.SimpleAsyncTaskExecutor; import org.springframework.integration.handler.AbstractReplyProducingMessageHandler; import org.springframework.integration.support.management.ManageableLifecycle; import org.springframework.lang.Nullable; @@ -66,7 +67,7 @@ public class GatewayMessageHandler extends AbstractReplyProducingMessageHandler private boolean errorOnTimeout; - private Executor executor; + private Executor executor = new SimpleAsyncTaskExecutor(); public void setRequestChannel(MessageChannel requestChannel) { this.requestChannel = requestChannel; @@ -147,6 +148,7 @@ public class GatewayMessageHandler extends AbstractReplyProducingMessageHandler this.gatewayProxyFactoryBean.setDefaultReplyChannelName(this.replyChannelName); this.gatewayProxyFactoryBean.setErrorChannel(this.errorChannel); this.gatewayProxyFactoryBean.setErrorChannelName(this.errorChannelName); + this.gatewayProxyFactoryBean.setErrorOnTimeout(this.errorOnTimeout); this.gatewayProxyFactoryBean.setAsyncExecutor(this.executor); if (this.requestTimeout != null) { this.gatewayProxyFactoryBean.setDefaultRequestTimeout(this.requestTimeout);