How can I execute a method after all the messages are put on to Kafka after split.
I have tried using handle() after channel, but that ends up not posting from 2nd message on to Kafka.
IntegrationFlowBuilder flowBuilder = IntegrationFlows
.from(() -> jdbcTemplate....);
flowBuilder.split();
flowBuilder.channel(messageChannel);
I would like to execute a method after writing all the split messages to Kafka.
Since you split and only after that send to the Kafka, there is no way to catch all of them, unless aggregate
afterwards. You can do that with the publishSubscribeChannel
to send to the Kafka and aggregator the same message. When aggregator releases a group, you are good to perform your method call.