I have just stared learning spring-integration I want to receive a message on a queue and perform 2 steps in parallel: Step 1 -> Process it using a bean Step 2 -> Transform and send it to another queue. Something like :
return IntegrationFlows.from(Amqp.inboundAdapter(connectionFactory, "queue1")
.configureContainer(simpleMessageListenerContainerSpec -> {
simpleMessageListenerContainerSpec.concurrentConsumers(3);
}))
.log(message -> "SERVICE EVENT QUEUE : Received Message : " + message.getPayload())
.handle(serviceBean, "process")
.<String,String>transform(String::toLowerCase)
.log(message -> "SERVICE EVENT QUEUE : Transformed Message : " + message.getPayload())
.handle(
Amqp.outboundAdapter(rabbitTemplate)
.exchangeName("exchange")
.routingKey("queue2.routing"))
.get();
What am I missing? The action after the first handle is not getting executed. I think I am not understanding this part correctly. Also how can I do these 2 steps in parallel?