I am trying to upgrade the spring integration flow in one of my existing application with Reactive Streams Support. The approach taken is to change the parameter and return type of the Gateway method as Mono. The flow executes smoothly and when the reply reaches the Gateway, it results in java.lang.IllegalArgumentException: 'beanFactory' must not be null
I am using Spring Boot 2.3.0.
inputChannel is a DirectChannel
gatewayReplyChannel is a FluxMessageChannel
@MessagingGateway(name = "reactiveGateway")
public interface EntryGate {
@Gateway(requestChannel = "inputChannel", replyChannel = "gatewayReplyChannel")
Mono<String> process(final Mono<String> input);
}
Exceptions trace
Caused by: java.lang.IllegalArgumentException: 'beanFactory' must not be null
at org.springframework.util.Assert.notNull(Assert.java:198)
at org.springframework.integration.channel.ChannelUtils.getErrorHandler(ChannelUtils.java:51)
at org.springframework.integration.endpoint.ReactiveStreamsConsumer.onInit(ReactiveStreamsConsumer.java:155)
at org.springframework.integration.context.IntegrationObjectSupport.afterPropertiesSet(IntegrationObjectSupport.java:214)
at org.springframework.integration.gateway.MessagingGatewaySupport.registerReplyMessageCorrelatorIfNecessary(MessagingGatewaySupport.java:806)
at org.springframework.integration.gateway.MessagingGatewaySupport.sendAndReceiveMessageReactive(MessagingGatewaySupport.java:609)
at org.springframework.integration.gateway.GatewayProxyFactoryBean.sendOrSendAndReceive(GatewayProxyFactoryBean.java:639)
at org.springframework.integration.gateway.GatewayProxyFactoryBean.invokeGatewayMethod(GatewayProxyFactoryBean.java:573)
Can anyone help?