I'm trying to upgrade a project using Spring Integration 4.3 and Spring Boot 1.6 to Spring Integration 5.1 and Spring Boot 2.1. Previously I had the following configuration:
IntegrationFlows.from(Amqp.inboundAdapter(connectionFactory, "queueName")
.id("myId")
.autoStartup(autoStartup)
.prefetchCount(10)
.concurrentConsumers(2)
.maxConcurrentConsumers(3)
.messageConverter(messageConverter()))
.aggregate(a -> a.correlationExpression("payload.entityId")
.releaseExpression("size() eq iterator().next().payload.batchSize")
.sendPartialResultOnExpiry(true)
.groupTimeout(2000)
.expireGroupsUponCompletion(true)
.outputProcessor(myMessageGroupProcessor))
.handle(serviceActivatorBean, "myMethod", e -> e.advice(requestHandlerRetryAdviceForIntegrationFlow()))
.get();
During the upgrade process I've tried to follow the documentation here and thus changed the configuration to this:
@Configuration
@EnableAutoConfiguration
@EnableIntegration
public class SpringConfig {
@Bean(name = "myFlowId")
public IntegrationFlow myFlow(ConnectionFactory connectionFactory, ServiceActivatorBean serviceActivatorBean,
@Value("${spring.integration.flow.auto-startup:true}") boolean autoStartup,
MyMessageGroupProcessor myMessageGroupProcessor) {
IntegrationFlows.from(Amqp.inboundAdapter(connectionFactory, "queueName")
.id("myId")
.autoStartup(autoStartup)
.configureContainer(c -> c.acknowledgeMode(MANUAL)
.prefetchCount(10)
.concurrentConsumers(2)
.maxConcurrentConsumers(3)
)
.messageConverter(messageConverter()))
.aggregate(a -> a.correlationExpression("payload.entityId")
.releaseExpression("size() eq one().payload.batchSize")
.sendPartialResultOnExpiry(true)
.groupTimeout(2000)
.expireGroupsUponCompletion(true)
.outputProcessor(myMessageGroupProcessor))
.handle(serviceActivatorBean, "myMethod", e -> e.advice(requestHandlerRetryAdviceForIntegrationFlow()))
.get();
}
}
But when I publish messages it doesn't seem like they're received/handled by the integration flow. I get no error logs (or any logs at all for that matter even though I enable debug logging) and I'm not quite sure where to start debugging. I'm positive that the messages are actually published to RabbitMQ so that's not the problem. What could I be missing?